public final class IotHubTransportPacket
extends java.lang.Object
| Constructor and Description |
|---|
IotHubTransportPacket(Message message,
MessageSentCallback eventCallback,
java.lang.Object callbackContext,
IotHubStatusCode status,
long startTimeMillis,
java.lang.String deviceId)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MessageSentCallback |
getCallback()
Getter for the callback to be invoked when a response is received.
|
java.lang.Object |
getContext()
Getter for the context to be passed to the callback when it is invoked.
|
int |
getCurrentRetryAttempt()
Getter for current retry attempt.
|
java.lang.String |
getDeviceId()
Get the Id of the device that this packet is being sent from.
|
Message |
getMessage()
Getter for the message to be sent.
|
long |
getStartTimeMillis()
Getter for startTimeMillis
|
IotHubStatusCode |
getStatus()
Get the status of this transport packet
|
void |
incrementRetryAttempt()
Increments the saved retry attempt count by 1
|
void |
setStatus(IotHubStatusCode status)
Set the status of this transport packet
|
public IotHubTransportPacket(Message message, MessageSentCallback eventCallback, java.lang.Object callbackContext, IotHubStatusCode status, long startTimeMillis, java.lang.String deviceId) throws java.lang.IllegalArgumentException
message - the message to be sent.eventCallback - the callback to be invoked when a response from the IoT Hub is received.callbackContext - the context to be passed to the callback.status - the status code associated with the messagestartTimeMillis - the milliseconds since epoch that this packet was created. Used for tracking how long a
packet has been in process fordeviceId - The Id of the device that this message will be sent by.java.lang.IllegalArgumentException - if startTimeMillis is 0 or negativepublic Message getMessage()
public MessageSentCallback getCallback()
null.public java.lang.Object getContext()
public IotHubStatusCode getStatus()
public void setStatus(IotHubStatusCode status)
status - the status to set for this packetpublic long getStartTimeMillis()
public int getCurrentRetryAttempt()
public void incrementRetryAttempt()
public java.lang.String getDeviceId()
Copyright © 2023. All rights reserved.