Class AbstractAwsIotClient
java.lang.Object
com.amazonaws.services.iot.client.core.AbstractAwsIotClient
- All Implemented Interfaces:
AwsIotConnectionCallback
- Direct Known Subclasses:
AWSIotMqttClient
The actual implementation of
AWSIotMqttClient.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected booleanprotected final booleanprotected final Stringprotected final Stringprotected intprotected final AwsIotConnectionTypeprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected AWSIotMessage -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAwsIotClient(String clientEndpoint, String clientId, CredentialsProvider provider, String region) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, CredentialsProvider provider, String region, boolean enableSdkMetrics) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, boolean enableSdkMetrics) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, String region) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, String region, boolean enableSdkMetrics) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, KeyStore keyStore, String keyPassword) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, KeyStore keyStore, String keyPassword, boolean enableSdkMetrics) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, boolean enableSdkMetrics) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, int port) protectedAbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, int port, boolean enableSdkMetrics) -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(AWSIotDevice device) voidconnect()voidconnect(long timeout) voidconnect(long timeout, boolean blocking) voiddetach(AWSIotDevice device) voidvoiddisconnect(long timeout) voiddisconnect(long timeout, boolean blocking) voiddispatch(AWSIotMessage message) intintintintintintintintgetPort()intbooleanbooleanvoidOn connection closed.voidOn connection failure.voidOn connection success.voidpublish(AWSIotMessage message) voidpublish(AWSIotMessage message, long timeout) voidvoidvoidvoidvoidvoidvoidvoidFuture<?>scheduleRoutineTask(Runnable runnable, long initialDelay, long period) Future<?>scheduleTask(Runnable runnable) Future<?>scheduleTimeoutTask(Runnable runnable, long timeout) voidsetBaseRetryDelay(int baseRetryDelay) voidsetCleanSession(boolean cleanSession) voidsetConnectionTimeout(int connectionTimeout) voidsetExecutionService(ScheduledExecutorService executionService) voidsetKeepAliveInterval(int keepAliveInterval) voidsetMaxConnectionRetries(int maxConnectionRetries) voidsetMaxOfflineQueueSize(int maxOfflineQueueSize) voidsetMaxRetryDelay(int maxRetryDelay) voidsetNumOfClientThreads(int numOfClientThreads) voidsetPort(int port) voidsetServerAckTimeout(int serverAckTimeout) voidsetWillMessage(AWSIotMessage willMessage) voidsubscribe(AWSIotTopic topic) voidsubscribe(AWSIotTopic topic, boolean blocking) voidsubscribe(AWSIotTopic topic, long timeout) voidsubscribe(AWSIotTopic topic, long timeout, boolean blocking) booleantopicFilterMatch(String topicFilter, String topic) voidunsubscribe(AWSIotTopic topic) voidunsubscribe(AWSIotTopic topic, long timeout) voidunsubscribe(String topic) voidunsubscribe(String topic, long timeout) voidupdateCredentials(String awsAccessKeyId, String awsSecretAccessKey, String sessionToken)
-
Field Details
-
clientId
-
clientEndpoint
-
clientEnableMetrics
protected final boolean clientEnableMetrics -
connectionType
-
port
protected int port -
numOfClientThreads
protected int numOfClientThreads -
connectionTimeout
protected int connectionTimeout -
serverAckTimeout
protected int serverAckTimeout -
keepAliveInterval
protected int keepAliveInterval -
maxConnectionRetries
protected int maxConnectionRetries -
baseRetryDelay
protected int baseRetryDelay -
maxRetryDelay
protected int maxRetryDelay -
maxOfflineQueueSize
protected int maxOfflineQueueSize -
cleanSession
protected boolean cleanSession -
willMessage
-
-
Constructor Details
-
AbstractAwsIotClient
-
AbstractAwsIotClient
-
AbstractAwsIotClient
-
AbstractAwsIotClient
-
AbstractAwsIotClient
-
AbstractAwsIotClient
-
AbstractAwsIotClient
protected AbstractAwsIotClient(String clientEndpoint, String clientId, CredentialsProvider provider, String region) -
AbstractAwsIotClient
protected AbstractAwsIotClient(String clientEndpoint, String clientId, CredentialsProvider provider, String region, boolean enableSdkMetrics) -
AbstractAwsIotClient
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, boolean enableSdkMetrics) -
AbstractAwsIotClient
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory) -
AbstractAwsIotClient
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, int port, boolean enableSdkMetrics) -
AbstractAwsIotClient
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, int port)
-
-
Method Details
-
updateCredentials
-
connect
- Throws:
AWSIotException
-
connect
-
connect
-
disconnect
- Throws:
AWSIotException
-
disconnect
-
disconnect
public void disconnect(long timeout, boolean blocking) throws AWSIotException, AWSIotTimeoutException -
publish
- Throws:
AWSIotException
-
publish
public void publish(String topic, String payload, long timeout) throws AWSIotException, AWSIotTimeoutException -
publish
- Throws:
AWSIotException
-
publish
public void publish(String topic, AWSIotQos qos, String payload, long timeout) throws AWSIotException, AWSIotTimeoutException -
publish
- Throws:
AWSIotException
-
publish
public void publish(String topic, byte[] payload, long timeout) throws AWSIotException, AWSIotTimeoutException -
publish
- Throws:
AWSIotException
-
publish
public void publish(String topic, AWSIotQos qos, byte[] payload, long timeout) throws AWSIotException, AWSIotTimeoutException -
publish
- Throws:
AWSIotException
-
publish
- Throws:
AWSIotException
-
subscribe
- Throws:
AWSIotException
-
subscribe
public void subscribe(AWSIotTopic topic, long timeout, boolean blocking) throws AWSIotException, AWSIotTimeoutException -
subscribe
- Throws:
AWSIotException
-
subscribe
- Throws:
AWSIotException
-
unsubscribe
- Throws:
AWSIotException
-
unsubscribe
-
unsubscribe
- Throws:
AWSIotException
-
unsubscribe
- Throws:
AWSIotException
-
topicFilterMatch
-
dispatch
-
attach
- Throws:
AWSIotException
-
detach
- Throws:
AWSIotException
-
getConnectionStatus
-
onConnectionSuccess
public void onConnectionSuccess()Description copied from interface:AwsIotConnectionCallbackOn connection success.- Specified by:
onConnectionSuccessin interfaceAwsIotConnectionCallback
-
onConnectionFailure
public void onConnectionFailure()Description copied from interface:AwsIotConnectionCallbackOn connection failure.- Specified by:
onConnectionFailurein interfaceAwsIotConnectionCallback
-
onConnectionClosed
public void onConnectionClosed()Description copied from interface:AwsIotConnectionCallbackOn connection closed.- Specified by:
onConnectionClosedin interfaceAwsIotConnectionCallback
-
scheduleTask
-
scheduleTimeoutTask
-
scheduleRoutineTask
-
getClientId
-
getClientEndpoint
-
isClientEnableMetrics
public boolean isClientEnableMetrics() -
getConnectionType
-
getPort
public int getPort() -
getNumOfClientThreads
public int getNumOfClientThreads() -
getConnectionTimeout
public int getConnectionTimeout() -
getServerAckTimeout
public int getServerAckTimeout() -
getKeepAliveInterval
public int getKeepAliveInterval() -
getMaxConnectionRetries
public int getMaxConnectionRetries() -
getBaseRetryDelay
public int getBaseRetryDelay() -
getMaxRetryDelay
public int getMaxRetryDelay() -
getMaxOfflineQueueSize
public int getMaxOfflineQueueSize() -
isCleanSession
public boolean isCleanSession() -
getWillMessage
-
getSubscriptions
-
getDevices
-
getConnection
-
getExecutionService
-
setPort
public void setPort(int port) -
setNumOfClientThreads
public void setNumOfClientThreads(int numOfClientThreads) -
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) -
setServerAckTimeout
public void setServerAckTimeout(int serverAckTimeout) -
setKeepAliveInterval
public void setKeepAliveInterval(int keepAliveInterval) -
setMaxConnectionRetries
public void setMaxConnectionRetries(int maxConnectionRetries) -
setBaseRetryDelay
public void setBaseRetryDelay(int baseRetryDelay) -
setMaxRetryDelay
public void setMaxRetryDelay(int maxRetryDelay) -
setMaxOfflineQueueSize
public void setMaxOfflineQueueSize(int maxOfflineQueueSize) -
setCleanSession
public void setCleanSession(boolean cleanSession) -
setWillMessage
-
setExecutionService
-