Class TransportParameter.TransportParameterBuilder
java.lang.Object
de.iip_ecosphere.platform.transport.connectors.TransportParameter.TransportParameterBuilder
- Enclosing class:
TransportParameter
A builder for transport parameter. Connectors shall indicate the required settings.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the created instance.newBuilder(de.iip_ecosphere.platform.support.ServerAddress addr) Creates a new builder.newBuilder(TransportParameter params) Creates a transport parameter builder from (a copy of) the given transport parameters.newBuilder(String host, int port) Creates a new builder.setActionTimeout(int actionTimeout) Sets the action timeout.setApplicationId(String applicationId) Defines the optional application id.setAuthenticationKey(String authenticationKey) Defines theIdentityStorekey for the authentication, usually a password token.setAutoApplicationId(boolean autoApplicationId) Defines whether the application identification is expected to be unique or shall be made unique upon first connect.Defines the close action.setHostnameVerification(boolean hostnameVerification) Defines whether TLS hostname verification shall be performed.setKeepAlive(int keepAlive) Sets the keep alive time.setKeyAlias(String alias) Sets up optional TLS key alias.setKeystoreKey(String keystoreKey) Sets up the optional TLS keystore key to be obtained fromIdentityStore.setMqttQoS(MqttQoS qos) Defines the MQTT QoS level (may not apply to other protocols).
-
Field Details
-
instance
-
-
Constructor Details
-
TransportParameterBuilder
private TransportParameterBuilder()Prevents external creation.
-
-
Method Details
-
newBuilder
Creates a new builder.- Parameters:
host- the network name of the hostport- the TCP communication port of the host- Returns:
- the builder instance
-
newBuilder
public static TransportParameter.TransportParameterBuilder newBuilder(de.iip_ecosphere.platform.support.ServerAddress addr) Creates a new builder.- Parameters:
addr- the server address (schema ignored)- Returns:
- the builder instance
-
newBuilder
Creates a transport parameter builder from (a copy of) the given transport parameters.- Parameters:
params- the parameters to copy from- Returns:
- the transport parameter builder
-
setApplicationId
Defines the optional application id. Optional, remains empty if unset.- Parameters:
applicationId- the client/application id- Returns:
- this
-
setAutoApplicationId
Defines whether the application identification is expected to be unique or shall be made unique upon first connect. May be ignored if not applicable.- Parameters:
autoApplicationId-true(default) for make unique,falseelse- Returns:
- this
-
setKeepAlive
Sets the keep alive time. Optional, remains 2000 if unset.- Parameters:
keepAlive- the time to keep a connection alive (heartbeat) in milliseconds- Returns:
- this
-
setActionTimeout
Sets the action timeout. Optional, remains 1000 if unset.- Parameters:
actionTimeout- the timeout in milliseconds for send/receive actions- Returns:
- this
-
setKeystoreKey
Sets up the optional TLS keystore key to be obtained fromIdentityStore.- Parameters:
keystoreKey- the (logical) key to access the keystore (null for none)- Returns:
- this
-
setKeyAlias
Sets up optional TLS key alias.- Parameters:
alias- key alias, may be null for none/first match- Returns:
- this
-
setAuthenticationKey
Defines theIdentityStorekey for the authentication, usually a password token.- Parameters:
authenticationKey- the identity store key, may be empty or null- Returns:
- this
-
setHostnameVerification
public TransportParameter.TransportParameterBuilder setHostnameVerification(boolean hostnameVerification) Defines whether TLS hostname verification shall be performed.- Parameters:
hostnameVerification-falsefor no verification,trueelse- Returns:
- this
-
setMqttQoS
Defines the MQTT QoS level (may not apply to other protocols).- Parameters:
qos- the QoS level (default isMqttQoS.AT_LEAST_ONCE- Returns:
- this
-
setCloseAction
public TransportParameter.TransportParameterBuilder setCloseAction(TransportParameter.CloseAction action) Defines the close action.- Parameters:
action- the action (default isTransportParameter.CloseAction.UNSUBSCRIBE)- Returns:
- this
-
build
Returns the created instance.- Returns:
- the created instance
-