Class ConnectorParameter

java.lang.Object
de.iip_ecosphere.platform.connectors.ConnectorParameter

public class ConnectorParameter extends Object
Defines the connection parameters for a Connector. Specific connectors shall document required parameter.
Author:
Holger Eichelberger, SSE
  • Field Details

    • ANY_ENDPOINT

      public static final String 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

      private Map<String,de.iip_ecosphere.platform.support.identities.IdentityToken> identityToken
    • schema

      private de.iip_ecosphere.platform.support.Schema schema
    • port

      private int port
    • host

      private String host
    • requestTimeout

      private int requestTimeout
    • endpointPath

      private String endpointPath
    • applicationId

      private String applicationId
    • autoApplicationId

      private boolean autoApplicationId
    • applicationDescription

      private String applicationDescription
    • notificationInterval

      private int notificationInterval
    • keepAlive

      private int keepAlive
    • keystoreKey

      private String keystoreKey
    • keyAlias

      private String keyAlias
    • hostnameVerification

      private boolean hostnameVerification
    • cacheMode

      private ConnectorParameter.CacheMode cacheMode
    • service

      private de.iip_ecosphere.platform.support.iip_aas.NameplateSetup.Service service
    • specificSettings

      private Map<String,Object> specificSettings
  • Constructor Details

    • ConnectorParameter

      private ConnectorParameter(String host, int port)
      Creates a connector parameter instance.
      Parameters:
      host - the host to connect to
      port - 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:
      true for totally anonymous, false for at least some identities
    • isFeasibleEndpoint

      public boolean isFeasibleEndpoint(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 question
      securityLevel - connector specific information about the security level
      Returns:
      true for feasible (default), false else
    • 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 String getHost()
      Returns the server host.
      Returns:
      the server host name
    • getEndpointPath

      public String getEndpointPath()
      Returns the base URL prefix path/endpoint URL.
      Returns:
      the base URL prefix/endpoint URL
    • getApplicationId

      public String getApplicationId()
      String/URL to identify the application. Connector-dependent.
      Returns:
      the identifier
    • getApplicationDescription

      public 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, false else
    • getKeystoreKey

      public String getKeystoreKey()
      Returns the optional key to access the TLS keystore key to be obtained from IdentityStore.
      Returns:
      the (logical) key to access the keystore, may be null for none
    • getKeyAlias

      public String getKeyAlias()
      Returns the alias of the key in getKeystoreKey() to use.
      Returns:
      the alias or null for none/first match
    • getHostnameVerification

      public boolean getHostnameVerification()
      Returns whether TLS hostname verification shall be performed.
      Returns:
      false for no verification (default), true else
    • 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
    • getSpecificSetting

      public Object getSpecificSetting(String key)
      Returns a connector specific setting.
      Parameters:
      key - the key of the setting as defined by the connect
      Returns:
      the value, may be null
    • getSpecificSettingKeys

      public Set<String> getSpecificSettingKeys()
      Returns all defined specific setting keys.
      Returns:
      the specific setting keys
    • getSpecificStringSetting

      public String getSpecificStringSetting(String key)
      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

      public Integer getSpecificIntSetting(String key)
      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

      public void setSpecificIntSetting(String key, Consumer<Integer> setter)
      Applies the connector specific setting in key if specified to setter.
      Parameters:
      key - the key of the setting as defined by the connect
      setter - the value setter