HttpsBatchMessage Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. transport. https. HttpsBatchMessage
- com.
Implements
public final class HttpsBatchMessage
implements HttpsMessage
Builds a batched IoT Hub request body as a JSON array. The batched message has a maximum size of 256 kb.
Constructor Summary
| Constructor | Description |
|---|---|
| HttpsBatchMessage() |
Constructor. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
addMessage(HttpsSingleMessage msg)
Adds a message to the batch. |
| byte[] |
getBody()
Returns the current batch body as a UTF-8 encoded byte array. |
| java.lang.String |
getContentType()
Returns the message content-type as 'application/vnd. |
|
Message |
getProperties()
Returns an empty list of properties for the batched message. |
| java.util.Map<java.lang.String,java.lang.String> |
getSystemProperties()
It is part of the Https |
| int |
numMessages()
Returns the number of messages currently in the batch. |
Methods inherited from java.lang.Object
Constructor Details
HttpsBatchMessage
public HttpsBatchMessage()
Constructor. Initializes the batch body as an empty JSON array.
Method Details
addMessage
public void addMessage(HttpsSingleMessage msg)
Adds a message to the batch.
Parameters:
Throws:
getBody
public byte[] getBody()
Returns the current batch body as a UTF-8 encoded byte array.
Returns:
getContentType
public String getContentType()
Returns the message content-type as 'application/vnd.microsoft.iothub.json'.
Returns:
getProperties
public MessageProperty[] getProperties()
Returns an empty list of properties for the batched message.
Returns:
getSystemProperties
public Map<String,String> getSystemProperties()
It is part of the HttpsMessage interface to get the collection of system message properties. For batch, it just returns a empty Map.
Returns:
numMessages
public int numMessages()
Returns the number of messages currently in the batch.
Returns: