Class BasicConfiguration
java.lang.Object
de.iip_ecosphere.platform.transport.spring.BasicConfiguration
Defines a basic TLS-prepared configuration for binders.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionHelper method to determine a SSL/TLS context.protected de.iip_ecosphere.platform.transport.connectors.TransportParameter.TransportParameterBuilderTurns the information in this class into a default transport parameter builder.Helper method to determine a trust manager factory.Returns theIdentityStorekey for the authentication, usually a password token.getHost()Returns the broker host name.booleanReturns whether TLS hostname verification shall be performed.Returns the alias denoting the key to use.Returns the optional identity key for the TLS keystore.intgetPort()Returns the broker port number.voidsetAuthenticationKey(String authenticationKey) Returns theIdentityStorekey for the authentication, usually a password token.voidChanges the broker host name.voidsetHostnameVerification(boolean hostnameVerification) Returns whether TLS hostname verification shall be performed.voidsetKeyAlias(String alias) Returns the alias denoting the key to use.voidsetKeystoreKey(String keystoreKey) Changes the optional identity key for the TLS keystore.voidsetPort(int port) Defines the broker port number.de.iip_ecosphere.platform.transport.connectors.TransportParameterTurns the actual configuration into aTransportParameterinstance.booleanuseTls()Returns whether the connector shall use TLS.
-
Field Details
-
host
-
port
private int port -
keystoreKey
-
keyAlias
-
hostnameVerification
private boolean hostnameVerification -
authenticationKey
-
-
Constructor Details
-
BasicConfiguration
public BasicConfiguration()
-
-
Method Details
-
getHost
Returns the broker host name.- Returns:
- the broker host name
-
getPort
public int getPort()Returns the broker port number.- Returns:
- the broker port number to connect to
-
getKeystoreKey
Returns the optional identity key for the TLS keystore.- Returns:
- the identity key, null for none
-
getKeyAlias
Returns the alias denoting the key to use.- Returns:
- the alias, may be null for none/first match
-
getHostnameVerification
public boolean getHostnameVerification()Returns whether TLS hostname verification shall be performed.- Returns:
falsefor no verification (default),trueelse
-
getAuthenticationKey
Returns theIdentityStorekey for the authentication, usually a password token.- Returns:
- the identity store key, may be empty or null
-
setHost
Changes the broker host name. [required by Spring]- Parameters:
host- the broker host name
-
setPort
public void setPort(int port) Defines the broker port number. [required by Spring]- Parameters:
port- the broker port number to connect to
-
setKeystoreKey
Changes the optional identity key for the TLS keystore.- Parameters:
keystoreKey- the identity key, null for none
-
setKeyAlias
Returns the alias denoting the key to use.- Parameters:
alias- the alias, may be null for none/first match
-
setHostnameVerification
public void setHostnameVerification(boolean hostnameVerification) Returns whether TLS hostname verification shall be performed.- Parameters:
hostnameVerification-falsefor no verification,trueelse
-
setAuthenticationKey
Returns theIdentityStorekey for the authentication, usually a password token. [requred by SnakeYaml]- Parameters:
authenticationKey- the identity store key, may be empty or null
-
toTransportParameter
public de.iip_ecosphere.platform.transport.connectors.TransportParameter toTransportParameter()Turns the actual configuration into aTransportParameterinstance. When overriding this method, please considercreateTransportParameterBuilder()as default implementation for transferring the settings in this class.- Returns:
- the transport parameter instance
-
createTransportParameterBuilder
protected de.iip_ecosphere.platform.transport.connectors.TransportParameter.TransportParameterBuilder createTransportParameterBuilder()Turns the information in this class into a default transport parameter builder.- Returns:
builder
-
useTls
public boolean useTls()Returns whether the connector shall use TLS.- Returns:
truefor TLS enabled,falseelse
-
createTrustManagerFactory
Helper method to determine a trust manager factory. Apply only ifuseTls()returnstrue.- Returns:
- the trust manager factory
- Throws:
IOException- if creating the context or obtaining key information fails
-
createTlsContext
Helper method to determine a SSL/TLS context. Apply only ifuseTls()returnstrue. Relies onIdentityStore#createTlsContext(String, String, String...)ifTransportParameter.getKeystoreKey()is given, else onSslUtils.createTlsContext(java.io.File, String, String).- Returns:
- the TLS context
- Throws:
IOException- if creating the context or obtaining key information fails
-