Class ConnectorParameter.ConnectorParameterBuilder
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.ConnectorParameter.ConnectorParameterBuilder
-
- Enclosing class:
- ConnectorParameter
public static class ConnectorParameter.ConnectorParameterBuilder extends java.lang.ObjectBuilds a connector parameter object.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private ConnectorParameterinstance
-
Constructor Summary
Constructors Modifier Constructor Description privateConnectorParameterBuilder()Prevents external creation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectorParameterbuild()Creates the instance.static ConnectorParameter.ConnectorParameterBuildernewBuilder(ConnectorParameter params)Creates a new connector parameter builder based on the givenparams.static ConnectorParameter.ConnectorParameterBuildernewBuilder(ConnectorParameter params, java.lang.String host, java.lang.Integer port, de.iip_ecosphere.platform.support.Schema schema)Creates a new connector parameter builder based on the givenparams.static ConnectorParameter.ConnectorParameterBuildernewBuilder(de.iip_ecosphere.platform.support.ServerAddress addr)Creates a new connector parameter builder with required basic information.static ConnectorParameter.ConnectorParameterBuildernewBuilder(java.lang.String host, int port)Creates a new connector parameter builder with required basic information.static ConnectorParameter.ConnectorParameterBuildernewBuilder(java.lang.String host, int port, de.iip_ecosphere.platform.support.Schema schema)Creates a new connector parameter builder with required basic information.ConnectorParameter.ConnectorParameterBuildersetApplicationInformation(java.lang.String applicationId, java.lang.String applicationDescription)Sets connector-dependent application information.ConnectorParameter.ConnectorParameterBuildersetAutoApplicationId(boolean autoApplicationId)Defines whether the application identification is expected to be unique or shall be made unique upon first connect.ConnectorParameter.ConnectorParameterBuildersetCacheMode(ConnectorParameter.CacheMode cacheMode)Defines the cache mode.ConnectorParameter.ConnectorParameterBuildersetEndpointPath(java.lang.String endpointPath)Sets a connector-dependent endpoint path, a URL path.ConnectorParameter.ConnectorParameterBuildersetHostnameVerification(boolean hostnameVerification)Defines whether TLS hostname verification shall be performed.ConnectorParameter.ConnectorParameterBuildersetIdentities(java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.identities.IdentityToken> identityToken)Sets the endpoint identities.ConnectorParameter.ConnectorParameterBuildersetKeepAlive(int keepAlive)Sets the keep alive time for connection heartbeats/reconnects (if supported).ConnectorParameter.ConnectorParameterBuildersetKeyAlias(java.lang.String alias)Sets up optional TLS key alias.ConnectorParameter.ConnectorParameterBuildersetKeystoreKey(java.lang.String keystoreKey)Sets up the optional TLS keystore key to be obtained fromIdentityStore.ConnectorParameter.ConnectorParameterBuildersetNotificationInterval(int notificationInterval)Defines the notification interval, i.e., how frequently the connector shall look for new values.ConnectorParameter.ConnectorParameterBuildersetRequestTimeout(int requestTimeout)Sets the request timeout.ConnectorParameter.ConnectorParameterBuildersetService(de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service service)Sets the optional service information to select upon.
-
-
-
Field Detail
-
instance
private ConnectorParameter instance
-
-
Method Detail
-
newBuilder
public static ConnectorParameter.ConnectorParameterBuilder newBuilder(java.lang.String host, int port)
Creates a new connector parameter builder with required basic information. Schema is set toConnectorParameter.DEFAULT_SCHEMA.- Parameters:
host- the host to connect toport- the port to connect to- Returns:
- the connector parameter builder
-
newBuilder
public static ConnectorParameter.ConnectorParameterBuilder newBuilder(java.lang.String host, int port, de.iip_ecosphere.platform.support.Schema schema)
Creates a new connector parameter builder with required basic information.- Parameters:
host- the host to connect toport- the port to connect toschema- protocol schema, usually (ConnectorParameter.DEFAULT_SCHEMAif value is null)- Returns:
- the connector parameter builder
-
newBuilder
public static ConnectorParameter.ConnectorParameterBuilder newBuilder(ConnectorParameter params, java.lang.String host, java.lang.Integer port, de.iip_ecosphere.platform.support.Schema schema)
Creates a new connector parameter builder based on the givenparams.- Parameters:
params- the connector params to take information fromhost- the host name to override the value inparams, may be null for the value fromparams.port- the port number to override the value inparams, may be null for the value fromparams.schema- the schema to override the value inparams, may be null for the value fromparams.- Returns:
- the connector parameter builder
-
newBuilder
public static ConnectorParameter.ConnectorParameterBuilder newBuilder(ConnectorParameter params)
Creates a new connector parameter builder based on the givenparams.- Parameters:
params- the connector params to take information from- Returns:
- the connector parameter builder
-
newBuilder
public static ConnectorParameter.ConnectorParameterBuilder newBuilder(de.iip_ecosphere.platform.support.ServerAddress addr)
Creates a new connector parameter builder with required basic information.- Parameters:
addr- the server address- Returns:
- the connector parameter builder
-
setService
public ConnectorParameter.ConnectorParameterBuilder setService(de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service service)
Sets the optional service information to select upon.- Parameters:
service- the device service information the connector shall connect to- Returns:
- this
-
setEndpointPath
public ConnectorParameter.ConnectorParameterBuilder setEndpointPath(java.lang.String endpointPath)
Sets a connector-dependent endpoint path, a URL path. Optional, remains an empty string if not called.- Parameters:
endpointPath- the endpoint path- Returns:
- this
-
setRequestTimeout
public ConnectorParameter.ConnectorParameterBuilder setRequestTimeout(int requestTimeout)
Sets the request timeout.- Parameters:
requestTimeout- the request timeout. Optional, if not called uses the default value of 5000 ms.- Returns:
- this
-
setKeepAlive
public ConnectorParameter.ConnectorParameterBuilder setKeepAlive(int keepAlive)
Sets the keep alive time for connection heartbeats/reconnects (if supported).- Parameters:
keepAlive- the keep alive time. Optional, if not called uses the default value of 2000 ms.- Returns:
- this
-
setNotificationInterval
public ConnectorParameter.ConnectorParameterBuilder setNotificationInterval(int notificationInterval)
Defines the notification interval, i.e., how frequently the connector shall look for new values. This may happen via events, notifications or polling depending on the connector implementation.- Parameters:
notificationInterval- the notification interval in ms, disabled if less than 1, default is 1000- Returns:
- the polling period
-
setApplicationInformation
public ConnectorParameter.ConnectorParameterBuilder setApplicationInformation(java.lang.String applicationId, java.lang.String applicationDescription)
Sets connector-dependent application information. Optional, if not called both settings will remain empty strings.- Parameters:
applicationId- String/URL to identify the application.applicationDescription- application description.- Returns:
- this
-
setAutoApplicationId
public ConnectorParameter.ConnectorParameterBuilder setAutoApplicationId(boolean autoApplicationId)
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
-
setIdentities
public ConnectorParameter.ConnectorParameterBuilder setIdentities(java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.identities.IdentityToken> identityToken)
Sets the endpoint identities. Optional, if not called, anonymous identity is assumed.- Parameters:
identityToken- the client identity token per endpoint URL (may be null for anonymous), anConnectorParameter.ANY_ENDPOINTdenotes just all endpoints- Returns:
- this
-
setKeystoreKey
public ConnectorParameter.ConnectorParameterBuilder setKeystoreKey(java.lang.String keystoreKey)
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
public ConnectorParameter.ConnectorParameterBuilder setKeyAlias(java.lang.String alias)
Sets up optional TLS key alias.- Parameters:
alias- key alias, may be null for none/first match- Returns:
- this
-
setHostnameVerification
public ConnectorParameter.ConnectorParameterBuilder setHostnameVerification(boolean hostnameVerification)
Defines whether TLS hostname verification shall be performed.- Parameters:
hostnameVerification-falsefor no verification,trueelse- Returns:
- this
-
setCacheMode
public ConnectorParameter.ConnectorParameterBuilder setCacheMode(ConnectorParameter.CacheMode cacheMode)
Defines the cache mode.- Parameters:
cacheMode- the cache mode- Returns:
- this
-
build
public ConnectorParameter build()
Creates the instance.- Returns:
- the created instance
-
-