public class Response extends Message
Response
messages are sent by service instances upon receiving Request
messages.
Response
messages are sent using the DxlClient.sendResponse(com.opendxl.client.message.Response)
method of a client instance. Clients
that are invoking the service (sending a request) will receive the response as a return value of the
DxlClient.syncRequest(com.opendxl.client.message.Request)
method of a client instance or via the ResponseCallback
callback when
invoking the asynchronous method, DxlClient.asyncRequest(com.opendxl.client.message.Request, com.opendxl.client.callback.ResponseCallback, long)
.CHARSET_ASCII, CHARSET_UTF8, MESSAGE_TYPE_ERROR, MESSAGE_TYPE_EVENT, MESSAGE_TYPE_REQUEST, MESSAGE_TYPE_RESPONSE, MESSAGE_VERSION
Constructor and Description |
---|
Response(DxlClient client,
Request request)
Constructor for
Response |
Response(Request request)
Constructor for
Response |
Response(java.lang.String sourceClientId,
Request request)
Constructor for
Response |
Modifier and Type | Method and Description |
---|---|
byte |
getMessageType()
Returns the numeric type of the message
|
Request |
getRequest()
Returns the
Request message that this is a response for |
java.lang.String |
getRequestMessageId()
Returns the unique identifier (UUID) for the
Request message that this message is a response for. |
java.lang.String |
getServiceId()
Returns the identifier of the service that sent this response (the service that the corresponding
Request was routed to). |
fromBytes, getBrokerIds, getClientIds, getDestinationTopic, getDestTenantGuids, getMessageId, getMessagePack, getOtherFields, getPayload, getSourceBrokerId, getSourceClientId, getSourceClientInstanceId, getSourceTenantGuid, getVersion, setBrokerIds, setClientIds, setDestinationTopic, setDestTenantGuids, setOtherFields, setPayload, setSourceClientId, setSourceClientInstanceId, setSourceTenantGuid, toBytes
public Response(DxlClient client, Request request)
Response
client
- The client that will be sending this responserequest
- The Request
message that this is a response forpublic Response(Request request)
Response
request
- The Request
message that this is a response forpublic byte getMessageType()
getMessageType
in class Message
public java.lang.String getRequestMessageId()
Request
message that this message is a response for.
This is used by the invoking DxlClient
to correlate an incoming Response
message with the
Request
message that was initially sent by the client.Request
message that this message is a response for.public Request getRequest()
Request
message that this is a response forRequest
message that this is a response for