Class ConnectorParameter
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.ConnectorParameter
-
public class ConnectorParameter extends java.lang.ObjectDefines the connection parameters for aConnector. Specific connectors shall document required parameter.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConnectorParameter.CacheModeModes for caching data avoiding repeated ingestion.static classConnectorParameter.ConnectorParameterBuilderBuilds a connector parameter object.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringANY_ENDPOINTprivate java.lang.StringapplicationDescriptionprivate java.lang.StringapplicationIdprivate booleanautoApplicationIdprivate ConnectorParameter.CacheModecacheModestatic intDEFAULT_KEEP_ALIVEstatic intDEFAULT_NOTIFICATION_INTERVALstatic intDEFAULT_REQUEST_TIMEOUTstatic de.iip_ecosphere.platform.support.SchemaDEFAULT_SCHEMAprivate java.lang.StringendpointPathprivate java.lang.Stringhostprivate booleanhostnameVerificationprivate java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.identities.IdentityToken>identityTokenprivate intkeepAliveprivate java.lang.StringkeyAliasprivate java.lang.StringkeystoreKeyprivate intnotificationIntervalprivate intportprivate intrequestTimeoutprivate de.iip_ecosphere.platform.support.Schemaschemaprivate de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Serviceservice
-
Constructor Summary
Constructors Modifier Constructor Description privateConnectorParameter(java.lang.String host, int port)Creates a connector parameter instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetApplicationDescription()Application description.java.lang.StringgetApplicationId()String/URL to identify the application.booleangetAutoApplicationId()Returns whether the application identification is expected to be unique or shall be made unique upon first connect.ConnectorParameter.CacheModegetCacheMode()Returns the cache mode.java.lang.StringgetEndpointPath()Returns the base URL prefix path/endpoint URL.java.lang.StringgetHost()Returns the server host.booleangetHostnameVerification()Returns whether TLS hostname verification shall be performed.de.iip_ecosphere.platform.support.identities.IdentityTokengetIdentityToken(java.lang.String endpointUrl)Returns the identity token.intgetKeepAlive()Returns the time to keep a connection alive.java.lang.StringgetKeyAlias()Returns the alias of the key ingetKeystoreKey()to use.java.lang.StringgetKeystoreKey()Returns the optional key to access the TLS keystore key to be obtained fromIdentityStore.intgetNotificationInterval()Returns the notification interval, i.e., how frequently the connector shall look for new values.intgetPort()The connection port.intgetRequestTimeout()Returns the request timeout.de.iip_ecosphere.platform.support.SchemagetSchema()The connection schema.de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.ServicegetService()Returns the device service information this connector shall connect to.booleanisAnonymousIdentity()Returns whether there is any identity or the client just runs in anonymous mode.booleanisFeasibleEndpoint(java.lang.String endpointUrl, byte securityLevel)Helps determining in case of multiple endpoint URLs which ones are more feasible.
-
-
-
Field Detail
-
ANY_ENDPOINT
public static final java.lang.String ANY_ENDPOINT
- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
DEFAULT_NOTIFICATION_INTERVAL
public static final int DEFAULT_NOTIFICATION_INTERVAL
- See Also:
- Constant Field Values
-
DEFAULT_KEEP_ALIVE
public static final int DEFAULT_KEEP_ALIVE
- See Also:
- Constant Field Values
-
identityToken
private java.util.Map<java.lang.String,de.iip_ecosphere.platform.support.identities.IdentityToken> identityToken
-
schema
private de.iip_ecosphere.platform.support.Schema schema
-
port
private int port
-
host
private java.lang.String host
-
requestTimeout
private int requestTimeout
-
endpointPath
private java.lang.String endpointPath
-
applicationId
private java.lang.String applicationId
-
autoApplicationId
private boolean autoApplicationId
-
applicationDescription
private java.lang.String applicationDescription
-
notificationInterval
private int notificationInterval
-
keepAlive
private int keepAlive
-
keystoreKey
private java.lang.String keystoreKey
-
keyAlias
private java.lang.String keyAlias
-
hostnameVerification
private boolean hostnameVerification
-
cacheMode
private ConnectorParameter.CacheMode cacheMode
-
service
private de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service service
-
-
Method Detail
-
getIdentityToken
public de.iip_ecosphere.platform.support.identities.IdentityToken getIdentityToken(java.lang.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
public boolean isFeasibleEndpoint(java.lang.String endpointUrl, byte securityLevel)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
public java.lang.String getHost()
Returns the server host.- Returns:
- the server host name
-
getEndpointPath
public java.lang.String getEndpointPath()
Returns the base URL prefix path/endpoint URL.- Returns:
- the base URL prefix/endpoint URL
-
getApplicationId
public java.lang.String getApplicationId()
String/URL to identify the application. Connector-dependent.- Returns:
- the identifier
-
getApplicationDescription
public java.lang.String 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
public java.lang.String 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
public java.lang.String 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
public ConnectorParameter.CacheMode 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
-
-