public class RELPResponse extends Object
Modifier and Type | Field and Description |
---|---|
private int |
code |
private String |
data |
static int |
ERROR |
private String |
message |
static int |
OK |
static String |
RSP_CMD |
private long |
txnr |
Constructor and Description |
---|
RELPResponse(long txnr,
int code) |
RELPResponse(long txnr,
int code,
String message,
String data) |
Modifier and Type | Method and Description |
---|---|
static RELPResponse |
error(long txnr)
Utility method to create a default "ERROR" response.
|
static RELPResponse |
ok(long txnr)
Utility method to create a default "OK" response.
|
static RELPResponse |
open(long txnr,
Map<String,String> offers)
Utility method to create a response to an open request.
|
static Map<String,String> |
parseOffers(byte[] data,
Charset charset)
Parses the provided data into a Map of offers.
|
RELPFrame |
toFrame(Charset charset)
Creates a RELPFrame where the data portion will contain this response.
|
public static final int OK
public static final int ERROR
public static final String RSP_CMD
private final long txnr
private final int code
private final String message
private final String data
public RELPFrame toFrame(Charset charset)
charset
- the character set to encode the responsepublic static RELPResponse open(long txnr, Map<String,String> offers)
txnr
- the transaction number of the open requestoffers
- the accepted offerspublic static RELPResponse ok(long txnr)
txnr
- the transaction number being responded topublic static RELPResponse error(long txnr)
txnr
- the transaction number being responded topublic static Map<String,String> parseOffers(byte[] data, Charset charset)
data
- the data portion of a RELPFrame for an "open" commandcharset
- the charset to decode the dataCopyright © 2020 Apache NiFi Project. All rights reserved.