Class AwsIotDeviceCommand
- java.lang.Object
-
- com.amazonaws.services.iot.client.AWSIotMessage
-
- com.amazonaws.services.iot.client.core.AwsIotCompletion
-
- com.amazonaws.services.iot.client.shadow.AwsIotDeviceCommand
-
- All Implemented Interfaces:
AwsIotMessageCallback
public class AwsIotDeviceCommand extends AwsIotCompletion
This is a helper class that can be used to manage the execution result of a shadow command, i.e. get, update, and delete. It makes sure that the command is not published until the subscription requests for the acknowledgment topics, namely accepted and rejected, have completed successfully.- See Also:
AwsIotCompletion
-
-
Field Summary
-
Fields inherited from class com.amazonaws.services.iot.client.core.AwsIotCompletion
hasFailure, hasSuccess, hasTimeout, isAsync, request, timeout, timeoutTask
-
Fields inherited from class com.amazonaws.services.iot.client.AWSIotMessage
errorCode, errorMessage, payload, qos, topic
-
-
Constructor Summary
Constructors Constructor Description AwsIotDeviceCommand(AwsIotDeviceCommandManager commandManager, AwsIotDeviceCommandManager.Command command, String commandId, AWSIotMessage request, long commandTimeout, boolean isAsync)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget(AbstractAwsIotDevice device)AwsIotDeviceCommandManager.CommandgetCommand()StringgetCommandId()AwsIotDeviceCommandManagergetCommandManager()BooleangetRequestSent()AWSIotMessagegetResponse()voidonFailure()Callback function to be invoked a non-block API has completed unsuccessfully.booleanonReady(AbstractAwsIotDevice device)voidonSuccess()Callback function to be invoked a non-block API has completed successfully.voidonTimeout()Callback function to be invoked a non-block API has timed out.voidput(AbstractAwsIotDevice device)voidsetResponse(AWSIotMessage response)-
Methods inherited from class com.amazonaws.services.iot.client.core.AwsIotCompletion
get
-
Methods inherited from class com.amazonaws.services.iot.client.AWSIotMessage
getErrorCode, getErrorMessage, getPayload, getQos, getStringPayload, getTopic, setErrorCode, setErrorMessage, setPayload, setQos, setStringPayload, setTopic
-
-
-
-
Constructor Detail
-
AwsIotDeviceCommand
public AwsIotDeviceCommand(AwsIotDeviceCommandManager commandManager, AwsIotDeviceCommandManager.Command command, String commandId, AWSIotMessage request, long commandTimeout, boolean isAsync)
-
-
Method Detail
-
put
public void put(AbstractAwsIotDevice device) throws AWSIotException
- Throws:
AWSIotException
-
get
public String get(AbstractAwsIotDevice device) throws AWSIotException, AWSIotTimeoutException
-
onReady
public boolean onReady(AbstractAwsIotDevice device)
-
onSuccess
public void onSuccess()
Description copied from class:AWSIotMessageCallback function to be invoked a non-block API has completed successfully.- Specified by:
onSuccessin interfaceAwsIotMessageCallback- Overrides:
onSuccessin classAwsIotCompletion
-
onFailure
public void onFailure()
Description copied from class:AWSIotMessageCallback function to be invoked a non-block API has completed unsuccessfully.- Specified by:
onFailurein interfaceAwsIotMessageCallback- Overrides:
onFailurein classAwsIotCompletion
-
onTimeout
public void onTimeout()
Description copied from class:AWSIotMessageCallback function to be invoked a non-block API has timed out.- Specified by:
onTimeoutin interfaceAwsIotMessageCallback- Overrides:
onTimeoutin classAwsIotCompletion
-
getCommandManager
public AwsIotDeviceCommandManager getCommandManager()
-
getCommand
public AwsIotDeviceCommandManager.Command getCommand()
-
getCommandId
public String getCommandId()
-
getResponse
public AWSIotMessage getResponse()
-
getRequestSent
public Boolean getRequestSent()
-
setResponse
public void setResponse(AWSIotMessage response)
-
-