Class ConnectorParameter
java.lang.Object
de.iip_ecosphere.platform.connectors.ConnectorParameter
Defines the connection parameters for a
Connector. Specific connectors shall document required parameter.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumModes for caching data avoiding repeated ingestion.static classBuilds a connector parameter object. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate Stringprivate Stringprivate booleanprivate ConnectorParameter.CacheModestatic final intstatic final intstatic final intstatic final de.iip_ecosphere.platform.support.Schemaprivate Stringprivate Stringprivate booleanprivate intprivate Stringprivate Stringprivate intprivate intprivate intprivate de.iip_ecosphere.platform.support.Schemaprivate de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConnectorParameter(String host, int port) Creates a connector parameter instance. -
Method Summary
Modifier and TypeMethodDescriptionApplication description.String/URL to identify the application.booleanReturns whether the application identification is expected to be unique or shall be made unique upon first connect.Returns the cache mode.Returns the base URL prefix path/endpoint URL.getHost()Returns the server host.booleanReturns whether TLS hostname verification shall be performed.de.iip_ecosphere.platform.support.identities.IdentityTokengetIdentityToken(String endpointUrl) Returns the identity token.intReturns the time to keep a connection alive.Returns the alias of the key ingetKeystoreKey()to use.Returns the optional key to access the TLS keystore key to be obtained fromIdentityStore.intReturns the notification interval, i.e., how frequently the connector shall look for new values.intgetPort()The connection port.intReturns the request timeout.de.iip_ecosphere.platform.support.SchemaThe connection schema.de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.ServiceReturns the device service information this connector shall connect to.Returns a connector specific setting as Integer.getSpecificSetting(String key) Returns a connector specific setting.Returns all defined specific setting keys.Returns a connector specific setting as String.booleanReturns whether there is any identity or the client just runs in anonymous mode.booleanisFeasibleEndpoint(String endpointUrl, byte securityLevel) Helps determining in case of multiple endpoint URLs which ones are more feasible.voidsetSpecificIntSetting(String key, Consumer<Integer> setter) Applies the connector specific setting inkeyif specified tosetter.
-
Field Details
-
ANY_ENDPOINT
- See Also:
-
DEFAULT_SCHEMA
public static final de.iip_ecosphere.platform.support.Schema DEFAULT_SCHEMA -
DEFAULT_REQUEST_TIMEOUT
public static final int DEFAULT_REQUEST_TIMEOUT- See Also:
-
DEFAULT_NOTIFICATION_INTERVAL
public static final int DEFAULT_NOTIFICATION_INTERVAL- See Also:
-
DEFAULT_KEEP_ALIVE
public static final int DEFAULT_KEEP_ALIVE- See Also:
-
identityToken
-
schema
private de.iip_ecosphere.platform.support.Schema schema -
port
private int port -
host
-
requestTimeout
private int requestTimeout -
endpointPath
-
applicationId
-
autoApplicationId
private boolean autoApplicationId -
applicationDescription
-
notificationInterval
private int notificationInterval -
keepAlive
private int keepAlive -
keystoreKey
-
keyAlias
-
hostnameVerification
private boolean hostnameVerification -
cacheMode
-
service
private de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service service -
specificSettings
-
-
Constructor Details
-
ConnectorParameter
Creates a connector parameter instance.- Parameters:
host- the host to connect toport- the port to connect to
-
-
Method Details
-
getIdentityToken
public de.iip_ecosphere.platform.support.identities.IdentityToken getIdentityToken(String endpointUrl) Returns the identity token.- Parameters:
endpointUrl- the endpoint URL to return the token for- Returns:
- the identity token (may be null for anonymous identity)
-
isAnonymousIdentity
public boolean isAnonymousIdentity()Returns whether there is any identity or the client just runs in anonymous mode.- Returns:
truefor totally anonymous,falsefor at least some identities
-
isFeasibleEndpoint
Helps determining in case of multiple endpoint URLs which ones are more feasible. Might not be used by all connector implementations.- Parameters:
endpointUrl- the endpoint URL in questionsecurityLevel- connector specific information about the security level- Returns:
truefor feasible (default),falseelse
-
getSchema
public de.iip_ecosphere.platform.support.Schema getSchema()The connection schema.- Returns:
- the schema (default
DEFAULT_SCHEMA)
-
getPort
public int getPort()The connection port.- Returns:
- the connection port
-
getHost
Returns the server host.- Returns:
- the server host name
-
getEndpointPath
Returns the base URL prefix path/endpoint URL.- Returns:
- the base URL prefix/endpoint URL
-
getApplicationId
String/URL to identify the application. Connector-dependent.- Returns:
- the identifier
-
getApplicationDescription
Application description. Connector-dependent.- Returns:
- the description
-
getRequestTimeout
public int getRequestTimeout()Returns the request timeout.- Returns:
- the request timeout in ms
-
getNotificationInterval
public int getNotificationInterval()Returns 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.- Returns:
- the interval in ms, deactivated if less than 1
-
getKeepAlive
public int getKeepAlive()Returns the time to keep a connection alive.- Returns:
- the time in milliseconds
-
getAutoApplicationId
public boolean getAutoApplicationId()Returns whether the application identification is expected to be unique or shall be made unique upon first connect. May be ignored if not applicable.- Returns:
true(default) for make unique,falseelse
-
getKeystoreKey
Returns the optional key to access the TLS keystore key to be obtained fromIdentityStore.- Returns:
- the (logical) key to access the keystore, may be null for none
-
getKeyAlias
Returns the alias of the key ingetKeystoreKey()to use.- Returns:
- the alias or null for none/first match
-
getHostnameVerification
public boolean getHostnameVerification()Returns whether TLS hostname verification shall be performed.- Returns:
falsefor no verification (default),trueelse
-
getCacheMode
Returns the cache mode.- Returns:
- the cache mode
-
getService
public de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service getService()Returns the device service information this connector shall connect to.- Returns:
- the device service information, may be null
-
getSpecificSetting
Returns a connector specific setting.- Parameters:
key- the key of the setting as defined by the connect- Returns:
- the value, may be null
-
getSpecificSettingKeys
Returns all defined specific setting keys.- Returns:
- the specific setting keys
-
getSpecificStringSetting
Returns a connector specific setting as String.- Parameters:
key- the key of the setting as defined by the connect- Returns:
- the value, may be null
-
getSpecificIntSetting
Returns a connector specific setting as Integer.- Parameters:
key- the key of the setting as defined by the connect- Returns:
- the value, may be null
-
setSpecificIntSetting
Applies the connector specific setting inkeyif specified tosetter.- Parameters:
key- the key of the setting as defined by the connectsetter- the value setter
-