Class TransportSetup

java.lang.Object
de.iip_ecosphere.platform.transport.connectors.TransportSetup
All Implemented Interfaces:
Serializable

public class TransportSetup extends Object implements Serializable
Implements a reusable class to read transport setup information and to turn the information into transport parameters.
Author:
Holger Eichelberger, SSE
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • host

      private String host
    • port

      private int port
    • keystoreKey

      private String keystoreKey
    • keyAlias

      private String keyAlias
    • hostnameVerification

      private boolean hostnameVerification
    • authenticationKey

      private String authenticationKey
    • gatewayPort

      private int gatewayPort
    • netmask

      private String netmask
  • Constructor Details

    • TransportSetup

      public TransportSetup()
  • Method Details

    • getHost

      public String getHost()
      Returns the server/broker host name.
      Returns:
      the server/broker host name.
    • getPort

      public int getPort()
      Returns the server/broker port number.
      Returns:
      the server/broker port
    • getKeystoreKey

      public String getKeystoreKey()
      Returns the optional TLS keystore key pointing into the IdentityStore.
      Returns:
      the TLS keystore key, 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
    • getAuthenticationKey

      public String getAuthenticationKey()
      Returns the IdentityStore key for the authentication, usually a password token.
      Returns:
      the identity store key, may be empty or null
    • getHostnameVerification

      public boolean getHostnameVerification()
      Returns whether TLS hostname verification shall be performed.
      Returns:
      false for no verification (default), true else
    • setHost

      public void setHost(String host)
      Defines the server/broker host name. [required by snakeyaml]
      Parameters:
      host - the server/broker host name.
    • setPort

      public void setPort(int port)
      Defines the server/broker port number. [required by snakeyaml]
      Parameters:
      port - the server/broker port
    • setKeystoreKey

      public void setKeystoreKey(String keystoreKey)
      Changes the optional TLS keystore key. [required by SnakeYaml]
      Parameters:
      keystoreKey - the TLS keystore key, may be null for none
    • setKeyAlias

      public void setKeyAlias(String keyAlias)
      Returns the alias of the key in getKeystoreKey() to use. [required by SnakeYaml]
      Parameters:
      keyAlias - the alias or null for none/first match
    • setAuthenticationKey

      public void setAuthenticationKey(String authenticationKey)
      Returns the IdentityStore key for the authentication, usually a password token. [required by SnakeYaml]
      Parameters:
      authenticationKey - the identity store key, may be empty or null
    • setHostnameVerification

      public void setHostnameVerification(boolean hostnameVerification)
      Returns whether TLS hostname verification shall be performed. [required by SnakeYaml]
      Parameters:
      hostnameVerification - false for no verification (default), true else
    • getGatewayPort

      public int getGatewayPort()
      Returns the transport gateway port (e.g., websocket).
      Returns:
      the port, negative indicates that dependent on the context none or an ephemeral port shall be used
    • setGatewayPort

      public void setGatewayPort(int gatewayPort)
      Changes the transport gateway/websocket port. [snakeyaml]
      Parameters:
      gatewayPort - the port, negative indicates that dependent on the context none or an ephemeral port shall be used
    • getNetmask

      public String getNetmask()
      Returns the netmask/network Java regex.
      Returns:
      the netmask/network Java regex
    • setNetmask

      public void setNetmask(String netmask)
      Defines the netmask/network Java regex. [snakeyaml]
      Parameters:
      netmask - the netmask
    • getGatewayServerEndpoint

      public de.iip_ecosphere.platform.support.Endpoint getGatewayServerEndpoint(de.iip_ecosphere.platform.support.Schema schema, String path)
      Returns the web socket server endpoint for a given path. The gateways server enables simplified pub-sub communication with the UI.
      Parameters:
      schema - the schema to use
      path - the path, may be empty, e.g., to obtain just an address
      Returns:
      the endpoint
      See Also:
    • isLocalGatewayEndpoint

      public boolean isLocalGatewayEndpoint()
      Returns whether this setup leads to a local gateway endpoint.
      Returns:
      true for a local endpoint, false for a global
    • createParameter

      public TransportParameter createParameter()
      Derives a transport parameter instance.
      Returns:
      the transport parameter instance
    • copy

      public TransportSetup copy()
      Copies this setup into a new instance.
      Returns:
      the copied instance