public static class TransportParameter.TransportParameterBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
private TransportParameter |
instance |
| Modifier | Constructor and Description |
|---|---|
private |
TransportParameterBuilder()
Prevents external creation.
|
| Modifier and Type | Method and Description |
|---|---|
TransportParameter |
build()
Returns the created instance.
|
static TransportParameter.TransportParameterBuilder |
newBuilder(de.iip_ecosphere.platform.support.ServerAddress addr)
Creates a new builder.
|
static TransportParameter.TransportParameterBuilder |
newBuilder(String host,
int port)
Creates a new builder.
|
TransportParameter.TransportParameterBuilder |
setActionTimeout(int actionTimeout)
Sets the action timeout.
|
TransportParameter.TransportParameterBuilder |
setApplicationId(String applicationId)
Defines the optional application id.
|
TransportParameter.TransportParameterBuilder |
setAuthenticationKey(String authenticationKey)
Defines the
IdentityStore key for the authentication, usually a password token. |
TransportParameter.TransportParameterBuilder |
setAutoApplicationId(boolean autoApplicationId)
Defines whether the application identification is expected to be unique or shall be made unique upon first
connect.
|
TransportParameter.TransportParameterBuilder |
setCloseAction(TransportParameter.CloseAction action)
Defines the close action.
|
TransportParameter.TransportParameterBuilder |
setHostnameVerification(boolean hostnameVerification)
Defines whether TLS hostname verification shall be performed.
|
TransportParameter.TransportParameterBuilder |
setKeepAlive(int keepAlive)
Sets the keep alive time.
|
TransportParameter.TransportParameterBuilder |
setKeyAlias(String alias)
Sets up optional TLS key alias.
|
TransportParameter.TransportParameterBuilder |
setKeystore(File keystore,
String password)
Sets up optional TLS encryption details.
|
TransportParameter.TransportParameterBuilder |
setMqttQoS(MqttQoS qos)
Defines the MQTT QoS level (may not apply to other protocols).
|
TransportParameter.TransportParameterBuilder |
setUser(String user,
String password)
Deprecated.
#22, use
setAuthenticationKey(String) instead |
private TransportParameter instance
private TransportParameterBuilder()
public static TransportParameter.TransportParameterBuilder newBuilder(String host, int port)
host - the network name of the hostport - the TCP communication port of the hostpublic static TransportParameter.TransportParameterBuilder newBuilder(de.iip_ecosphere.platform.support.ServerAddress addr)
addr - the server address (schema ignored)public TransportParameter.TransportParameterBuilder setApplicationId(String applicationId)
applicationId - the client/application idpublic TransportParameter.TransportParameterBuilder setAutoApplicationId(boolean autoApplicationId)
autoApplicationId - true (default) for make unique, false elsepublic TransportParameter.TransportParameterBuilder setKeepAlive(int keepAlive)
keepAlive - the time to keep a connection alive (heartbeat) in millisecondspublic TransportParameter.TransportParameterBuilder setActionTimeout(int actionTimeout)
actionTimeout - the timeout in milliseconds for send/receive actionspublic TransportParameter.TransportParameterBuilder setUser(String user, String password)
setAuthenticationKey(String) insteaduser - the user namepassword - the passwordpublic TransportParameter.TransportParameterBuilder setKeystore(File keystore, String password)
keystore - the TLS keystore (suffix ".jks" points to Java Key store, suffix ".p12" to PKCS12 keystore),
may be null for none; validity of the type of keystore may depend on the transport connector
implementation, e.g., PKCS12 may not work with all formspassword - the TLS keystore, may be null for none; the transport connector shall try a resolution
via the IdentityStore to obtain a password token before using it as a plaintext password as
fallbackpublic TransportParameter.TransportParameterBuilder setKeyAlias(String alias)
alias - key alias, may be null for none/first matchpublic TransportParameter.TransportParameterBuilder setAuthenticationKey(String authenticationKey)
IdentityStore key for the authentication, usually a password token.authenticationKey - the identity store key, may be empty or nullpublic TransportParameter.TransportParameterBuilder setHostnameVerification(boolean hostnameVerification)
hostnameVerification - false for no verification, true elsepublic TransportParameter.TransportParameterBuilder setMqttQoS(MqttQoS qos)
qos - the QoS level (default is MqttQoS.AT_LEAST_ONCEpublic TransportParameter.TransportParameterBuilder setCloseAction(TransportParameter.CloseAction action)
action - the action (default is TransportParameter.CloseAction.UNSUBSCRIBE)public TransportParameter build()
Copyright © 2022. All rights reserved.