Class TransportSetup
java.lang.Object
de.iip_ecosphere.platform.transport.connectors.TransportSetup
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Copies this setup into a new instance.Derives a transport parameter instance.Returns theIdentityStorekey for the authentication, usually a password token.intReturns the transport gateway port (e.g., websocket).de.iip_ecosphere.platform.support.EndpointgetGatewayServerEndpoint(de.iip_ecosphere.platform.support.Schema schema, String path) Returns the web socket server endpoint for a givenpath.getHost()Returns the server/broker host name.booleanReturns whether TLS hostname verification shall be performed.Returns the alias of the key ingetKeystoreKey()to use.Returns the optional TLS keystore key pointing into theIdentityStore.Returns the netmask/network Java regex.intgetPort()Returns the server/broker port number.booleanReturns whether this setup leads to a local gateway endpoint.voidsetAuthenticationKey(String authenticationKey) Returns theIdentityStorekey for the authentication, usually a password token.voidsetGatewayPort(int gatewayPort) Changes the transport gateway/websocket port.voidDefines the server/broker host name.voidsetHostnameVerification(boolean hostnameVerification) Returns whether TLS hostname verification shall be performed.voidsetKeyAlias(String keyAlias) Returns the alias of the key ingetKeystoreKey()to use.voidsetKeystoreKey(String keystoreKey) Changes the optional TLS keystore key.voidsetNetmask(String netmask) Defines the netmask/network Java regex.voidsetPort(int port) Defines the server/broker port number.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
host
-
port
private int port -
keystoreKey
-
keyAlias
-
hostnameVerification
private boolean hostnameVerification -
authenticationKey
-
gatewayPort
private int gatewayPort -
netmask
-
-
Constructor Details
-
TransportSetup
public TransportSetup()
-
-
Method Details
-
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
Returns the optional TLS keystore key pointing into theIdentityStore.- Returns:
- the TLS keystore key, may be null for none
-
getKeyAlias
Returns the alias of the key ingetKeystoreKey()to use.- Returns:
- the alias or null for none/first match
-
getAuthenticationKey
Returns theIdentityStorekey 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:
falsefor no verification (default),trueelse
-
setHost
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
Changes the optional TLS keystore key. [required by SnakeYaml]- Parameters:
keystoreKey- the TLS keystore key, may be null for none
-
setKeyAlias
Returns the alias of the key ingetKeystoreKey()to use. [required by SnakeYaml]- Parameters:
keyAlias- the alias or null for none/first match
-
setAuthenticationKey
Returns theIdentityStorekey 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-falsefor no verification (default),trueelse
-
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
Returns the netmask/network Java regex.- Returns:
- the netmask/network Java regex
-
setNetmask
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 givenpath. The gateways server enables simplified pub-sub communication with the UI.- Parameters:
schema- the schema to usepath- 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:
truefor a local endpoint,falsefor a global
-
createParameter
Derives a transport parameter instance.- Returns:
- the transport parameter instance
-
copy
Copies this setup into a new instance.- Returns:
- the copied instance
-