HttpsSingleMessage Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. transport. https. HttpsSingleMessage
- com.
Implements
public final class HttpsSingleMessage
implements HttpsMessage
A single HTTPS message.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| protected static final java.lang.String | CONTENT_ENCODING_KEY |
| protected static final java.lang.String | CONTENT_TYPE_KEY |
| protected static final java.lang.String |
CORRELATION_ID_KEY
The property names as they are saved in the system properties of this object |
| protected static final java.lang.String | MESSAGE_ID_KEY |
| protected static final java.lang.String | TO_KEY |
| protected static final java.lang.String | USER_ID_KEY |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| byte[] |
getBody()
Returns a copy of the message body. |
| java.lang.String |
getBodyAsString()
Returns the message body as a string. |
| java.lang.String |
getContentType()
Returns the message content-type. |
|
Message |
getProperties()
Returns a copy of the message properties. |
| java.util.Map<java.lang.String,java.lang.String> |
getSystemProperties()
Returns a copy of the message system properties. |
| boolean |
isBase64Encoded()
Returns whether the message is Base64-encoded. |
|
static
Https |
parseHttpsJsonMessage(Message message)
Returns the HTTPS message represented by the service-bound message for application json format. |
|
static
Https |
parseHttpsMessage(HttpsResponse response)
Returns the HTTPS message represented by the HTTPS response. |
|
static
Https |
parseHttpsMessage(Message message)
Returns the HTTPS message represented by the service-bound message for binary octets. |
| Message |
toMessage()
Returns the Iot Hub message represented by the HTTPS message. |
Methods inherited from java.lang.Object
Field Details
CONTENT_ENCODING_KEY
protected static final String CONTENT_ENCODING_KEY
CONTENT_TYPE_KEY
protected static final String CONTENT_TYPE_KEY
CORRELATION_ID_KEY
protected static final String CORRELATION_ID_KEY
The property names as they are saved in the system properties of this object
MESSAGE_ID_KEY
protected static final String MESSAGE_ID_KEY
TO_KEY
protected static final String TO_KEY
USER_ID_KEY
protected static final String USER_ID_KEY
Method Details
getBody
public byte[] getBody()
Returns a copy of the message body.
Returns:
getBodyAsString
public String getBodyAsString()
Returns the message body as a string. The body is encoded using charset UTF-8.
Returns:
getContentType
public String getContentType()
Returns the message content-type.
Returns:
getProperties
public MessageProperty[] getProperties()
Returns a copy of the message properties.
Returns:
getSystemProperties
public Map<String,String> getSystemProperties()
Returns a copy of the message system properties.
Returns:
isBase64Encoded
public boolean isBase64Encoded()
Returns whether the message is Base64-encoded.
Returns:
parseHttpsJsonMessage
public static HttpsSingleMessage parseHttpsJsonMessage(Message message)
Returns the HTTPS message represented by the service-bound message for application json format. Content type "application/json;charset=utf-8"
Parameters:
Returns:
parseHttpsMessage
public static HttpsSingleMessage parseHttpsMessage(HttpsResponse response)
Returns the HTTPS message represented by the HTTPS response.
Parameters:
Returns:
parseHttpsMessage
public static HttpsSingleMessage parseHttpsMessage(Message message)
Returns the HTTPS message represented by the service-bound message for binary octets. Content type "binary/octet-stream"
Parameters:
Returns:
toMessage
public Message toMessage()
Returns the Iot Hub message represented by the HTTPS message.
Returns: