Message 类

定义

public class Message
继承
java.lang.Object
Message

构造函数

Message()

Constructor.

Message(byte[] body)

Constructor.

Message(ByteArrayInputStream stream)

Constructor.

Message(String body)

Constructor.

字段

DEFAULT_IOTHUB_MESSAGE_CHARSET

方法

getBodyStream()

The stream content of the body.

getBytes()

The byte content of the body.

getConnectionDeviceId()
getConnectionModuleId()
getContentEncoding()

Returns this message's content encoding. This value is null by default

getContentType()

Return the message's content type. This value is null by default

getCorrelatingMessageCallback()
getCorrelatingMessageCallbackContext()
getCorrelationId()

Getter for the correlationId property

getCreationTimeUTC()
getCreationTimeUTCString()

Returns the iot hub accepted format for the creation time utc

ex: oct 1st, 2018 yields 2008-10-01T17:04:32.0000000

getDeliveryAcknowledgement()

Getter for the delivery acknowledgement system property

getInputName()
getIotHubConnectionString()

Getter for the iotHubConnectionString property

getMessageId()

Getter for the messageId property

getMessageType()

Getter for the Message type

getOutputName()
getProperties()

Returns a copy of the message properties.

getProperty(String name)

Gets the values of user-defined properties of this Message.

getTo()

Getter for the To system property

getUserId()

Getter for the User ID system property

isExpired()

Verifies whether the message is expired or not

isSecurityMessage()
setAbsoluteExpiryTime(long absoluteTimeout)

Setter for the expiryTime property using absolute time

setAsSecurityMessage()
setConnectionDeviceId(String connectionDeviceId)
setConnectionModuleId(String connectionModuleId)
setContentEncoding(String contentEncoding)

Set the content encoding of this message. Used in message routing.

setContentType(String contentType)

Set the content type of this message. Used in message routing.

<xreftitle>Deprecated</xreftitle>

<xrefdescription>

  <p>as of device-client version 1.14.1, please use <xref uid="com.microsoft.azure.sdk.iot.device.Message.setContentTypeFinal(String)" data-throw-if-not-resolved="false" data-raw-source="setContentTypeFinal(String)"></xref></p>

</xrefdescription>

setContentTypeFinal(String contentType)

Set the content type of this message. Used in message routing.

setCorrelatingMessageCallback(CorrelatingMessageCallback correlatingMessageCallback)
setCorrelatingMessageCallbackContext(Object correlatingMessageCallbackContext)
setCorrelationId(String correlationId)

Setter for the correlationId property

setCreationTimeUTC(Date creationTimeUTC)
setExpiryTime(long timeOut)

Setter for the expiryTime property. This setter uses relative time, not absolute time.

setInputName(String inputName)

Set the input name of the message, used in routing for module communications

setIotHubConnectionString(IotHubConnectionString iotHubConnectionString)

Setter for the iotHubConnectionString type

setMessageId(String messageId)

Setter for the messageId property

setMessageType(MessageType type)

Setter for the Message type

setOutputName(String outputName)

Set the output channel name to send to. Used in routing for module communications

setProperty(String name, String value)

Adds or sets user-defined properties of this Message.

setUserId(String userId)
toString()

适用于