Package com.plccom.mqtt.client
Class MqttRequestResponseResult
- java.lang.Object
-
- com.plccom.mqtt.OperationResult
-
- com.plccom.mqtt.client.MqttRequestResponseResult
-
public final class MqttRequestResponseResult extends OperationResult
Result of one high-level MQTT 5 request/response operation.The result keeps the request topic, response topic, correlation data and the received response message together. Correlation Data is copied at public boundaries because it is binary application-owned state and is often reused as an identifier in request maps or logs.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.plccom.mqtt.OperationResult
OperationResult.eQuality
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getCorrelationData()Returns the Correlation Data used to match the response.StringgetRequestTopic()Returns the Topic Name used for the request PUBLISH.MqttMessagegetResponse()Returns the matching response message.StringgetResponseTopic()Returns the MQTT 5 Response Topic advertised on the request.-
Methods inherited from class com.plccom.mqtt.OperationResult
getInnerException, getMessage, getMessage, getQuality, getResultCode, isGood, setInnerException, setMessage, setResult, setResult, setResult, toString
-
-
-
-
Method Detail
-
getRequestTopic
public String getRequestTopic()
Returns the Topic Name used for the request PUBLISH.- Returns:
- request Topic Name
-
getResponseTopic
public String getResponseTopic()
Returns the MQTT 5 Response Topic advertised on the request.- Returns:
- response Topic Name
-
getCorrelationData
public byte[] getCorrelationData()
Returns the Correlation Data used to match the response.- Returns:
- defensive copy of the correlation data, or
nullwhen the request was sent without Correlation Data
-
getResponse
public MqttMessage getResponse()
Returns the matching response message.- Returns:
- high-level response message view, or
nullif the operation failed before a matching response arrived
-
-