IotHubTransportMessage Class

  • java.lang.Object
    • Message
      • com.microsoft.azure.sdk.iot.device.transport.IotHubTransportMessage

public class IotHubTransportMessage extends Message

Extends Message, adding transport artifacts.

Constructor Summary

Constructor Description
IotHubTransportMessage(byte[] data, MessageType messageType)

Constructor with binary data and message type

IotHubTransportMessage(byte[] data, MessageType messageType, String messageId, String correlationId, MessageProperty[] messageProperties)
IotHubTransportMessage(String body)

Constructor.

Method Summary

Modifier and Type Method and Description
DeviceOperations getDeviceOperationType()

Getter for the device operation type

HttpsMethod getIotHubMethod()

Getter for the HTTPS method

MessageCallback getMessageCallback()
Object getMessageCallbackContext()
String getMethodName()

Getter for the method name of device method operation

String getRequestId()

Getter for the request id

String getStatus()

Getter for the request status

String getUriPath()

Getter for the URI path

int getVersion()

Getter for the message version

boolean isMessageAckNeeded(IotHubClientProtocol protocol)
void setDeviceOperationType(DeviceOperations deviceOperationType)

Setter for the device operation type

void setIotHubMethod(HttpsMethod iotHubMethod)

Setter for the IoT Hub method

void setMessageCallback(MessageCallback messageCallback)
void setMessageCallbackContext(Object messageCallbackContext)
void setMethodName(String methodName)

Setter for the method name of device method operation

void setRequestId(String id)

Setter for the message id

void setStatus(String status)

Setter for the status

void setUriPath(String uriPath)

Setter for the URI path

void setVersion(int version)

Setter for the message version

String toString()

Inherited Members

Message.DEFAULT_IOTHUB_MESSAGE_CHARSET Message.getBodyStream() Message.getBytes() Message.getConnectionDeviceId() Message.getConnectionModuleId() Message.getContentEncoding() Message.getContentType() Message.getCorrelatingMessageCallback() Message.getCorrelatingMessageCallbackContext() Message.getCorrelationId() Message.getCreationTimeUTC() Message.getCreationTimeUTCString() Message.getDeliveryAcknowledgement() Message.getInputName() Message.getIotHubConnectionString() Message.getMessageId() Message.getMessageType() Message.getOutputName() Message.getProperties() Message.getProperty(String name) Message.getTo() Message.getUserId() Message.isExpired() Message.isSecurityMessage() Message.Message() Message.Message(byte[] body) Message.Message(String body) Message.setAbsoluteExpiryTime(long absoluteTimeout) Message.setAsSecurityMessage() Message.setConnectionDeviceId(String connectionDeviceId) Message.setConnectionModuleId(String connectionModuleId) Message.setContentEncoding(String contentEncoding) Message.setContentType(String contentType) Message.setCorrelatingMessageCallback(CorrelatingMessageCallback correlatingMessageCallback) Message.setCorrelatingMessageCallbackContext(Object correlatingMessageCallbackContext) Message.setCorrelationId(String correlationId) Message.setCreationTimeUTC(Date creationTimeUTC) Message.setExpiryTime(long timeOut) Message.setInputName(String inputName) Message.setIotHubConnectionString(IotHubConnectionString iotHubConnectionString) Message.setMessageId(String messageId) Message.setMessageType(MessageType type) Message.setOutputName(String outputName) Message.setProperty(String name, String value) Message.setUserId(String userId)

Constructor Details

IotHubTransportMessage

public IotHubTransportMessage(byte[] data, MessageType messageType)

Constructor with binary data and message type

Parameters:

data - The byte array of the message.
messageType - The messageType of the message.

IotHubTransportMessage

public IotHubTransportMessage(byte[] data, MessageType messageType, String messageId, String correlationId, MessageProperty[] messageProperties)

Parameters:

data
messageType
messageId
correlationId
messageProperties

IotHubTransportMessage

public IotHubTransportMessage(String body)

Constructor.

Parameters:

body - The body of the new Message instance. It is internally serialized to a byte array using UTF-8 encoding.

Method Details

getDeviceOperationType

public DeviceOperations getDeviceOperationType()

Getter for the device operation type

Returns:

the DeviceOperations eum value with the current operation type.

getIotHubMethod

public HttpsMethod getIotHubMethod()

Getter for the HTTPS method

Returns:

the IoT Hub method (POST, GET).

getMessageCallback

public MessageCallback getMessageCallback()

getMessageCallbackContext

public Object getMessageCallbackContext()

getMethodName

public String getMethodName()

Getter for the method name of device method operation

Returns:

the methodName of device method operation.

getRequestId

public String getRequestId()

Getter for the request id

Returns:

the String containing the request id.

getStatus

public String getStatus()

Getter for the request status

Returns:

the String containing the request status.

getUriPath

public String getUriPath()

Getter for the URI path

Returns:

the string with the URI path.

getVersion

public int getVersion()

Getter for the message version

Returns:

the String containing the version.

isMessageAckNeeded

public boolean isMessageAckNeeded(IotHubClientProtocol protocol)

Parameters:

protocol

setDeviceOperationType

public void setDeviceOperationType(DeviceOperations deviceOperationType)

Setter for the device operation type

Parameters:

deviceOperationType - The DeviceOperations enum value.

setIotHubMethod

public void setIotHubMethod(HttpsMethod iotHubMethod)

Setter for the IoT Hub method

Parameters:

iotHubMethod - The HTTPS method.

setMessageCallback

public void setMessageCallback(MessageCallback messageCallback)

Parameters:

messageCallback

setMessageCallbackContext

public void setMessageCallbackContext(Object messageCallbackContext)

Parameters:

messageCallbackContext

setMethodName

public void setMethodName(String methodName)

Setter for the method name of device method operation

Parameters:

methodName - The String containing the method name of device method operation.

setRequestId

public void setRequestId(String id)

Setter for the message id

Parameters:

id - The String containing the id.

setStatus

public void setStatus(String status)

Setter for the status

Parameters:

status - The String containing the status.

setUriPath

public void setUriPath(String uriPath)

Setter for the URI path

Parameters:

uriPath - The string with the URI path.

setVersion

public void setVersion(int version)

Setter for the message version

Parameters:

version - The String containing the version.

toString

public String toString()

Applies to