Share via


IotHubTransportMessage Class

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

IotHubMethod getIotHubMethod()

Getter for the IoT Hub method

MessageCallback getMessageCallback()
java.lang.Object getMessageCallbackContext()
java.lang.String getMethodName()

Getter for the method name of device method operation

java.lang.String getRequestId()

Getter for the request id

java.lang.String getStatus()

Getter for the request status

java.lang.String getUriPath()

Getter for the URI path

java.lang.String getVersion()

Getter for the message version

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

Setter for the device operation type

void setIotHubMethod(IotHubMethod 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(String version)

Setter for the message version

java.lang.String toString()

Methods inherited from Message

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

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 DeviceTwin.DeviceOperations getDeviceOperationType()

Getter for the device operation type

Returns:

the DeviceOperations eum value with the current operation type.

getIotHubMethod

public IotHubMethod getIotHubMethod()

Getter for the IoT Hub 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 String getVersion()

Getter for the message version

Returns:

the String containing the version.

isMessageAckNeeded

public boolean isMessageAckNeeded(IotHubClientProtocol protocol)

Parameters:

protocol

setDeviceOperationType

public void setDeviceOperationType(DeviceTwin.DeviceOperations deviceOperationType)

Setter for the device operation type

Parameters:

deviceOperationType - The DeviceOperations enum value.

setIotHubMethod

public void setIotHubMethod(IotHubMethod iotHubMethod)

Setter for the IoT Hub method

Parameters:

iotHubMethod - The enum containing the IoT Hub 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(String version)

Setter for the message version

Parameters:

version - The String containing the version.

toString

public String toString()

Overrides:

IotHubTransportMessage.toString()

Applies to