public final class HttpsSingleMessage extends Object implements HttpsMessage
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
base64Encoded |
protected byte[] |
body |
static String |
HTTPS_SINGLE_MESSAGE_CONTENT_TYPE |
protected MessageProperty[] |
properties |
HTTPS_APP_PROPERTY_PREFIX| Modifier | Constructor and Description |
|---|---|
protected |
HttpsSingleMessage() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBody()
Returns a copy of the message body.
|
String |
getBodyAsString()
Returns the message body as a string.
|
String |
getContentType()
Returns the message content-type as 'binary/octet-stream'.
|
MessageProperty[] |
getProperties()
Returns a copy of the message properties.
|
protected static String |
httpsAppPropertyToAppProperty(String httpsAppProperty)
Returns an application-defined property name with the prefix 'iothub-app'
removed.
|
boolean |
isBase64Encoded()
Returns whether the message is Base64-encoded.
|
protected static boolean |
isValidHttpsAppProperty(String name,
String value)
Returns whether the property name and value constitute a valid HTTPS
application property.
|
static HttpsSingleMessage |
parseHttpsMessage(HttpsResponse response)
Returns the HTTPS message represented by the HTTPS response.
|
static HttpsSingleMessage |
parseHttpsMessage(Message message)
Returns the HTTPS message represented by the service-bound message.
|
Message |
toMessage()
Returns the Iot Hub message represented by the HTTPS message.
|
public static final String HTTPS_SINGLE_MESSAGE_CONTENT_TYPE
protected byte[] body
protected boolean base64Encoded
protected MessageProperty[] properties
public static HttpsSingleMessage parseHttpsMessage(Message message)
message - the service-bound message to be mapped to its HTTPS message
equivalent.public static HttpsSingleMessage parseHttpsMessage(HttpsResponse response)
response - the HTTPS response.public Message toMessage()
public byte[] getBody()
getBody in interface HttpsMessagepublic String getBodyAsString()
public String getContentType()
getContentType in interface HttpsMessagepublic boolean isBase64Encoded()
public MessageProperty[] getProperties()
getProperties in interface HttpsMessageprotected static boolean isValidHttpsAppProperty(String name, String value)
name - the property name.value - the property value.protected static String httpsAppPropertyToAppProperty(String httpsAppProperty)
httpsAppProperty - the HTTPS property name.Copyright © 2017. All rights reserved.