|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.paho.client.mqttv3.MqttConnectOptions
Stores options used when connecting to a server.
Constructor Summary | |
---|---|
MqttConnectOptions()
Constructs a new MqttConnectOptions object using the
default values.
|
Method Summary | |
---|---|
int |
getConnectionTimeout()
Returns the connection timeout value. |
int |
getKeepAliveInterval()
Returns the "keep alive" interval. |
char[] |
getPassword()
Returns the password to use for the connection. |
javax.net.SocketFactory |
getSocketFactory()
Returns the socket factory that will be used when connecting, or null if one has not been set. |
java.util.Properties |
getSSLProperties()
Returns the SSL properties for the connection. |
java.lang.String |
getUserName()
Returns the user name to use for the connection. |
MqttTopic |
getWillDestination()
Returns the topic to be used for last will and testament (LWT). |
MqttMessage |
getWillMessage()
Returns the message to be sent as last will and testament (LWT). |
boolean |
isCleanSession()
Returns whether the server should remember state for the client across reconnects. |
void |
setCleanSession(boolean cleanSession)
Sets whether the server should remember state for the client across reconnects. |
void |
setConnectionTimeout(int connectionTimeout)
Sets the connection timeout value. |
void |
setKeepAliveInterval(int keepAliveInterval)
Sets the "keep alive" interval. |
void |
setPassword(char[] password)
Sets the password to use for the connection. |
void |
setSocketFactory(javax.net.SocketFactory socketFactory)
Sets the SocketFactory to use. |
void |
setSSLProperties(java.util.Properties props)
Sets the SSL properties for the connection. |
void |
setUserName(java.lang.String userName)
Sets the user name to use for the connection. |
void |
setWill(MqttTopic topic,
byte[] payload,
int qos,
boolean retained)
Sets the "Last Will and Testament" (LWT) for the connection. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MqttConnectOptions()
MqttConnectOptions
object using the
default values.
The defaults are:
Method Detail |
public char[] getPassword()
public void setPassword(char[] password)
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
java.lang.IllegalArgumentException
- if the user name is blank or only
contains whitespace characters.public void setWill(MqttTopic topic, byte[] payload, int qos, boolean retained)
topic
- the topic to publish to.payload
- the byte payload for the message.qos
- the quality of service to publish the message at (0, 1 or 2).retained
- whether or not the message should be retained.public int getKeepAliveInterval()
setKeepAliveInterval(int)
public void setKeepAliveInterval(int keepAliveInterval)
The default value is 60 seconds
keepAliveInterval
- the interval, measured in seconds.public int getConnectionTimeout()
setConnectionTimeout(int)
public void setConnectionTimeout(int connectionTimeout)
connect
,
subscribe
and
unsubscribe
to complete.
The default timeout is 30 seconds.
connectionTimeout
- the timeout value, measured in seconds.public javax.net.SocketFactory getSocketFactory()
null
if one has not been set.
public void setSocketFactory(javax.net.SocketFactory socketFactory)
SocketFactory
to use. This allows an application
to apply its own policies around the creation of network sockets. If
using an SSL connection, an SSLSocketFactory
can be used
to supply application-specific security settings.
socketFactory
- the factory to use.public MqttTopic getWillDestination()
null
if LWT is not set.setWill(MqttTopic, byte[], int, boolean)
public MqttMessage getWillMessage()
IllegalStateException
being thrown.
null
if LWT is not set.public java.util.Properties getSSLProperties()
public void setSSLProperties(java.util.Properties props)
setSocketFactory(SocketFactory)
.
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 isCleanSession()
public void setCleanSession(boolean cleanSession)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |