Class ConnectorParameter.ConnectorParameterBuilder

  • Enclosing class:
    ConnectorParameter

    public static class ConnectorParameter.ConnectorParameterBuilder
    extends java.lang.Object
    Builds a connector parameter object.
    Author:
    Holger Eichelberger, SSE
    • Constructor Detail

      • ConnectorParameterBuilder

        private ConnectorParameterBuilder()
        Prevents external creation.
    • Method Detail

      • 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 to
        port - the port to connect to
        schema - protocol schema, usually (ConnectorParameter.DEFAULT_SCHEMA if 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 given params.
        Parameters:
        params - the connector params to take information from
        host - the host name to override the value in params, may be null for the value from params.
        port - the port number to override the value in params, may be null for the value from params.
        schema - the schema to override the value in params, may be null for the value from params.
        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, false else
        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), an ConnectorParameter.ANY_ENDPOINT denotes just all endpoints
        Returns:
        this
      • setKeystoreKey

        public ConnectorParameter.ConnectorParameterBuilder setKeystoreKey​(java.lang.String keystoreKey)
        Sets up the optional TLS keystore key to be obtained from IdentityStore.
        Parameters:
        keystoreKey - the (logical) key to access the keystore (null for none)
        Returns:
        this
      • setHostnameVerification

        public ConnectorParameter.ConnectorParameterBuilder setHostnameVerification​(boolean hostnameVerification)
        Defines whether TLS hostname verification shall be performed.
        Parameters:
        hostnameVerification - false for no verification, true else
        Returns:
        this
      • build

        public ConnectorParameter build()
        Creates the instance.
        Returns:
        the created instance