public abstract class AbstractAwsIotClient extends Object implements AwsIotConnectionCallback
AWSIotMqttClient
.Modifier and Type | Field and Description |
---|---|
protected int |
baseRetryDelay |
protected boolean |
cleanSession |
protected boolean |
clientEnableMetrics |
protected String |
clientEndpoint |
protected String |
clientId |
protected int |
connectionTimeout |
protected AwsIotConnectionType |
connectionType |
protected int |
keepAliveInterval |
protected int |
maxConnectionRetries |
protected int |
maxOfflineQueueSize |
protected int |
maxRetryDelay |
protected int |
numOfClientThreads |
protected int |
port |
protected int |
serverAckTimeout |
protected AWSIotMessage |
willMessage |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
KeyStore keyStore,
String keyPassword) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
KeyStore keyStore,
String keyPassword,
boolean enableSdkMetrics) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
SSLSocketFactory socketFactory) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
SSLSocketFactory socketFactory,
boolean enableSdkMetrics) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
SSLSocketFactory socketFactory,
int port) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
SSLSocketFactory socketFactory,
int port,
boolean enableSdkMetrics) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
String awsAccessKeyId,
String awsSecretAccessKey,
String sessionToken) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
String awsAccessKeyId,
String awsSecretAccessKey,
String sessionToken,
boolean enableSdkMetrics) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
String awsAccessKeyId,
String awsSecretAccessKey,
String sessionToken,
String region) |
protected |
AbstractAwsIotClient(String clientEndpoint,
String clientId,
String awsAccessKeyId,
String awsSecretAccessKey,
String sessionToken,
String region,
boolean enableSdkMetrics) |
Modifier and Type | Method and Description |
---|---|
void |
attach(AWSIotDevice device) |
void |
connect() |
void |
connect(long timeout) |
void |
connect(long timeout,
boolean blocking) |
void |
detach(AWSIotDevice device) |
void |
disconnect() |
void |
disconnect(long timeout) |
void |
disconnect(long timeout,
boolean blocking) |
void |
dispatch(AWSIotMessage message) |
int |
getBaseRetryDelay() |
String |
getClientEndpoint() |
String |
getClientId() |
AwsIotConnection |
getConnection() |
AWSIotConnectionStatus |
getConnectionStatus() |
int |
getConnectionTimeout() |
AwsIotConnectionType |
getConnectionType() |
ConcurrentMap<String,AbstractAwsIotDevice> |
getDevices() |
ScheduledExecutorService |
getExecutionService() |
int |
getKeepAliveInterval() |
int |
getMaxConnectionRetries() |
int |
getMaxOfflineQueueSize() |
int |
getMaxRetryDelay() |
int |
getNumOfClientThreads() |
int |
getPort() |
int |
getServerAckTimeout() |
ConcurrentMap<String,AWSIotTopic> |
getSubscriptions() |
AWSIotMessage |
getWillMessage() |
boolean |
isCleanSession() |
boolean |
isClientEnableMetrics() |
void |
onConnectionClosed()
On connection closed.
|
void |
onConnectionFailure()
On connection failure.
|
void |
onConnectionSuccess()
On connection success.
|
void |
publish(AWSIotMessage message) |
void |
publish(AWSIotMessage message,
long timeout) |
void |
publish(String topic,
AWSIotQos qos,
byte[] payload) |
void |
publish(String topic,
AWSIotQos qos,
byte[] payload,
long timeout) |
void |
publish(String topic,
AWSIotQos qos,
String payload) |
void |
publish(String topic,
AWSIotQos qos,
String payload,
long timeout) |
void |
publish(String topic,
byte[] payload) |
void |
publish(String topic,
byte[] payload,
long timeout) |
void |
publish(String topic,
String payload) |
void |
publish(String topic,
String payload,
long timeout) |
Future<?> |
scheduleRoutineTask(Runnable runnable,
long initialDelay,
long period) |
Future<?> |
scheduleTask(Runnable runnable) |
Future<?> |
scheduleTimeoutTask(Runnable runnable,
long timeout) |
void |
setBaseRetryDelay(int baseRetryDelay) |
void |
setCleanSession(boolean cleanSession) |
void |
setConnectionTimeout(int connectionTimeout) |
void |
setExecutionService(ScheduledExecutorService executionService) |
void |
setKeepAliveInterval(int keepAliveInterval) |
void |
setMaxConnectionRetries(int maxConnectionRetries) |
void |
setMaxOfflineQueueSize(int maxOfflineQueueSize) |
void |
setMaxRetryDelay(int maxRetryDelay) |
void |
setNumOfClientThreads(int numOfClientThreads) |
void |
setPort(int port) |
void |
setServerAckTimeout(int serverAckTimeout) |
void |
setWillMessage(AWSIotMessage willMessage) |
void |
subscribe(AWSIotTopic topic) |
void |
subscribe(AWSIotTopic topic,
boolean blocking) |
void |
subscribe(AWSIotTopic topic,
long timeout) |
void |
subscribe(AWSIotTopic topic,
long timeout,
boolean blocking) |
boolean |
topicFilterMatch(String topicFilter,
String topic) |
void |
unsubscribe(AWSIotTopic topic) |
void |
unsubscribe(AWSIotTopic topic,
long timeout) |
void |
unsubscribe(String topic) |
void |
unsubscribe(String topic,
long timeout) |
void |
updateCredentials(String awsAccessKeyId,
String awsSecretAccessKey,
String sessionToken) |
protected final String clientId
protected final String clientEndpoint
protected final boolean clientEnableMetrics
protected final AwsIotConnectionType connectionType
protected int port
protected int numOfClientThreads
protected int connectionTimeout
protected int serverAckTimeout
protected int keepAliveInterval
protected int maxConnectionRetries
protected int baseRetryDelay
protected int maxRetryDelay
protected int maxOfflineQueueSize
protected boolean cleanSession
protected AWSIotMessage willMessage
protected AbstractAwsIotClient(String clientEndpoint, String clientId, KeyStore keyStore, String keyPassword, boolean enableSdkMetrics)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, KeyStore keyStore, String keyPassword)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, boolean enableSdkMetrics)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, String region, boolean enableSdkMetrics)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, String awsAccessKeyId, String awsSecretAccessKey, String sessionToken, String region)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, boolean enableSdkMetrics)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, int port, boolean enableSdkMetrics)
protected AbstractAwsIotClient(String clientEndpoint, String clientId, SSLSocketFactory socketFactory, int port)
public void updateCredentials(String awsAccessKeyId, String awsSecretAccessKey, String sessionToken)
public void connect() throws AWSIotException
AWSIotException
public void connect(long timeout) throws AWSIotException, AWSIotTimeoutException
public void connect(long timeout, boolean blocking) throws AWSIotException, AWSIotTimeoutException
public void disconnect() throws AWSIotException
AWSIotException
public void disconnect(long timeout) throws AWSIotException, AWSIotTimeoutException
public void disconnect(long timeout, boolean blocking) throws AWSIotException, AWSIotTimeoutException
public void publish(String topic, String payload) throws AWSIotException
AWSIotException
public void publish(String topic, String payload, long timeout) throws AWSIotException, AWSIotTimeoutException
public void publish(String topic, AWSIotQos qos, String payload) throws AWSIotException
AWSIotException
public void publish(String topic, AWSIotQos qos, String payload, long timeout) throws AWSIotException, AWSIotTimeoutException
public void publish(String topic, byte[] payload) throws AWSIotException
AWSIotException
public void publish(String topic, byte[] payload, long timeout) throws AWSIotException, AWSIotTimeoutException
public void publish(String topic, AWSIotQos qos, byte[] payload) throws AWSIotException
AWSIotException
public void publish(String topic, AWSIotQos qos, byte[] payload, long timeout) throws AWSIotException, AWSIotTimeoutException
public void publish(AWSIotMessage message) throws AWSIotException
AWSIotException
public void publish(AWSIotMessage message, long timeout) throws AWSIotException
AWSIotException
public void subscribe(AWSIotTopic topic, boolean blocking) throws AWSIotException
AWSIotException
public void subscribe(AWSIotTopic topic, long timeout, boolean blocking) throws AWSIotException, AWSIotTimeoutException
public void subscribe(AWSIotTopic topic) throws AWSIotException
AWSIotException
public void subscribe(AWSIotTopic topic, long timeout) throws AWSIotException
AWSIotException
public void unsubscribe(String topic) throws AWSIotException
AWSIotException
public void unsubscribe(String topic, long timeout) throws AWSIotException, AWSIotTimeoutException
public void unsubscribe(AWSIotTopic topic) throws AWSIotException
AWSIotException
public void unsubscribe(AWSIotTopic topic, long timeout) throws AWSIotException
AWSIotException
public void dispatch(AWSIotMessage message)
public void attach(AWSIotDevice device) throws AWSIotException
AWSIotException
public void detach(AWSIotDevice device) throws AWSIotException
AWSIotException
public AWSIotConnectionStatus getConnectionStatus()
public void onConnectionSuccess()
AwsIotConnectionCallback
onConnectionSuccess
in interface AwsIotConnectionCallback
public void onConnectionFailure()
AwsIotConnectionCallback
onConnectionFailure
in interface AwsIotConnectionCallback
public void onConnectionClosed()
AwsIotConnectionCallback
onConnectionClosed
in interface AwsIotConnectionCallback
public Future<?> scheduleRoutineTask(Runnable runnable, long initialDelay, long period)
public String getClientId()
public String getClientEndpoint()
public boolean isClientEnableMetrics()
public AwsIotConnectionType getConnectionType()
public int getPort()
public int getNumOfClientThreads()
public int getConnectionTimeout()
public int getServerAckTimeout()
public int getKeepAliveInterval()
public int getMaxConnectionRetries()
public int getBaseRetryDelay()
public int getMaxRetryDelay()
public int getMaxOfflineQueueSize()
public boolean isCleanSession()
public AWSIotMessage getWillMessage()
public ConcurrentMap<String,AWSIotTopic> getSubscriptions()
public ConcurrentMap<String,AbstractAwsIotDevice> getDevices()
public AwsIotConnection getConnection()
public ScheduledExecutorService getExecutionService()
public void setPort(int port)
public void setNumOfClientThreads(int numOfClientThreads)
public void setConnectionTimeout(int connectionTimeout)
public void setServerAckTimeout(int serverAckTimeout)
public void setKeepAliveInterval(int keepAliveInterval)
public void setMaxConnectionRetries(int maxConnectionRetries)
public void setBaseRetryDelay(int baseRetryDelay)
public void setMaxRetryDelay(int maxRetryDelay)
public void setMaxOfflineQueueSize(int maxOfflineQueueSize)
public void setCleanSession(boolean cleanSession)
public void setWillMessage(AWSIotMessage willMessage)
public void setExecutionService(ScheduledExecutorService executionService)
Copyright © 2020. All rights reserved.