Constructor and Description |
---|
PahoConfiguration() |
Modifier and Type | Method and Description |
---|---|
PahoConfiguration |
copy() |
String |
getBrokerUrl() |
String |
getClientId() |
int |
getConnectionTimeout() |
Properties |
getCustomWebSocketHeaders() |
int |
getExecutorServiceTimeout() |
String |
getFilePersistenceDirectory() |
int |
getKeepAliveInterval() |
int |
getMaxInflight() |
int |
getMaxReconnectDelay() |
int |
getMqttVersion() |
String |
getPassword() |
PahoPersistence |
getPersistence() |
int |
getQos() |
String |
getServerURIs() |
SocketFactory |
getSocketFactory() |
Properties |
getSslClientProps() |
HostnameVerifier |
getSslHostnameVerifier() |
String |
getUserName() |
String |
getWillPayload() |
int |
getWillQos() |
String |
getWillTopic() |
boolean |
isAutomaticReconnect() |
boolean |
isCleanSession() |
boolean |
isHttpsHostnameVerificationEnabled() |
boolean |
isRetained() |
boolean |
isWillRetained() |
void |
setAutomaticReconnect(boolean automaticReconnect)
Sets whether the client will automatically attempt to reconnect to the server
if the connection is lost.
|
void |
setBrokerUrl(String brokerUrl)
The URL of the MQTT broker.
|
void |
setCleanSession(boolean cleanSession)
Sets whether the client and server should remember state across restarts and
reconnects.
|
void |
setClientId(String clientId)
MQTT client identifier.
|
void |
setConnectionTimeout(int connectionTimeout)
Sets the connection timeout value.
|
void |
setCustomWebSocketHeaders(Properties customWebSocketHeaders)
Sets the Custom WebSocket Headers for the WebSocket Connection.
|
void |
setExecutorServiceTimeout(int executorServiceTimeout)
Set the time in seconds that the executor service should wait when
terminating before forcefully terminating.
|
void |
setFilePersistenceDirectory(String filePersistenceDirectory)
Base directory used by file persistence.
|
void |
setHttpsHostnameVerificationEnabled(boolean httpsHostnameVerificationEnabled)
Whether SSL HostnameVerifier is enabled or not.
|
void |
setKeepAliveInterval(int keepAliveInterval)
Sets the keep alive interval.
|
void |
setMaxInflight(int maxInflight)
Sets the max inflight.
|
void |
setMaxReconnectDelay(int maxReconnectDelay)
Get the maximum time (in millis) to wait between reconnects
|
void |
setMqttVersion(int mqttVersion)
Sets the MQTT version.
|
void |
setPassword(String password)
Password to be used for authentication against the MQTT broker
|
void |
setPersistence(PahoPersistence persistence)
Client persistence to be used - memory or file.
|
void |
setQos(int qos)
Client quality of service level (0-2).
|
void |
setRetained(boolean retained)
Retain option
|
void |
setServerURIs(String serverURIs)
Set a list of one or more serverURIs the client may connect to.
|
void |
setSocketFactory(SocketFactory socketFactory)
Sets the SocketFactory to use.
|
void |
setSslClientProps(Properties sslClientProps)
Sets the SSL properties for the connection.
|
void |
setSslHostnameVerifier(HostnameVerifier sslHostnameVerifier)
Sets the HostnameVerifier for the SSL connection.
|
void |
setUserName(String userName)
Username to be used for authentication against the MQTT broker
|
void |
setWillPayload(String willPayload)
Sets the "Last Will and Testament" (LWT) for the connection.
|
void |
setWillQos(int willQos)
Sets the "Last Will and Testament" (LWT) for the connection.
|
void |
setWillRetained(boolean willRetained)
Sets the "Last Will and Testament" (LWT) for the connection.
|
void |
setWillTopic(String willTopic)
Sets the "Last Will and Testament" (LWT) for the connection.
|
public String getClientId()
public void setClientId(String clientId)
public String getBrokerUrl()
public void setBrokerUrl(String brokerUrl)
public int getQos()
public void setQos(int qos)
public boolean isRetained()
public void setRetained(boolean retained)
public PahoPersistence getPersistence()
public void setPersistence(PahoPersistence persistence)
public String getFilePersistenceDirectory()
public void setFilePersistenceDirectory(String filePersistenceDirectory)
public String getUserName()
public void setUserName(String userName)
public String getPassword()
public void setPassword(String password)
public int getKeepAliveInterval()
public void setKeepAliveInterval(int keepAliveInterval)
The default value is 60 seconds
public int getMaxInflight()
public void setMaxInflight(int maxInflight)
The default value is 10
public String getWillTopic()
public void setWillTopic(String willTopic)
public String getWillPayload()
public void setWillPayload(String willPayload)
public int getWillQos()
public void setWillQos(int willQos)
public boolean isWillRetained()
public void setWillRetained(boolean willRetained)
public SocketFactory getSocketFactory()
public void setSocketFactory(SocketFactory socketFactory)
public Properties getSslClientProps()
public void setSslClientProps(Properties sslClientProps)
Note that these properties are only valid if an implementation of the Java Secure Socket Extensions (JSSE) is available. These properties are not used if a custom SocketFactory has been set. The following properties can be used:
com.ibm.micro.security.Password.obfuscate(char[] password)
. This
obfuscates the password using a simple and insecure XOR and Base64 encoding
mechanism. Note that this is only a simple scrambler to obfuscate clear-text
passwords.com.ibm.micro.security.Password.obfuscate(char[] password)
. This
obfuscates the password using a simple and insecure XOR and Base64 encoding
mechanism. Note that this is only a simple scrambler to obfuscate clear-text
passwords.public boolean isHttpsHostnameVerificationEnabled()
public void setHttpsHostnameVerificationEnabled(boolean httpsHostnameVerificationEnabled)
public HostnameVerifier getSslHostnameVerifier()
public void setSslHostnameVerifier(HostnameVerifier sslHostnameVerifier)
There is no default HostnameVerifier
public boolean isCleanSession()
public void setCleanSession(boolean cleanSession)
public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
public String getServerURIs()
public void setServerURIs(String serverURIs)
Each serverURI
specifies the address of a server that the client
may connect to. Two types of connection are supported tcp://
for
a TCP connection and ssl://
for a TCP connection secured by
SSL/TLS. For example:
tcp://localhost:1883
ssl://localhost:8883
tcp://
" URIs, and 8883 for ssl://
URIs.
If serverURIs is set then it overrides the serverURI parameter passed in on the constructor of the MQTT client.
When an attempt to connect is initiated the client will start with the first serverURI in the list and work through the list until a connection is established with a server. If a connection cannot be made to any of the servers then the connect attempt fails.
Specifying a list of servers that a client may connect to has several uses:
Some MQTT servers support a high availability feature where two or more "equal" MQTT servers share state. An MQTT client can connect to any of the "equal" servers and be assured that messages are reliably delivered and durable subscriptions are maintained no matter which server the client connects to.
The cleansession flag must be set to false if durable subscriptions and/or reliable message delivery is required.
A set of servers may be specified that are not "equal" (as in the high availability option). As no state is shared across the servers reliable message delivery and durable subscriptions are not valid. The cleansession flag must be set to true if the hunt list mode is used
public int getMqttVersion()
public void setMqttVersion(int mqttVersion)
public boolean isAutomaticReconnect()
public void setAutomaticReconnect(boolean automaticReconnect)
public int getMaxReconnectDelay()
public void setMaxReconnectDelay(int maxReconnectDelay)
public Properties getCustomWebSocketHeaders()
public void setCustomWebSocketHeaders(Properties customWebSocketHeaders)
public int getExecutorServiceTimeout()
public void setExecutorServiceTimeout(int executorServiceTimeout)
public PahoConfiguration copy()
Apache Camel