public class ServerConfigurationHelper
extends java.lang.Object
ServerChannel
connection configuration initialization.
It uses COM AB style application configuration information and creates Endpoint
instance initialized with properties like listening TCP port number, ADDP
parameters, TLS options, etc.
Usage sample is following:
String appName = "<my-app-name>";
CfgApplication cfgApplication = confService.retrieveObject(
CfgApplication.class, new CfgApplicationQuery(appName));
GCOMApplicationConfiguration appConfig =
new GCOMApplicationConfiguration(cfgApplication);
Endpoint endpoint = ServerConfigurationHelper.createListeningEndpoint(
appConfig, appConfig.getPortInfo("default"));
ExternalServiceProtocolListener serverChannel =
new ExternalServiceProtocolListener(endpoint);
serverChannel.setReceiver(requestReceiver);
serverChannel.open();
...
Constructor | Description |
---|---|
ServerConfigurationHelper() |
Modifier and Type | Method | Description |
---|---|---|
static Endpoint |
createListeningEndpoint(IGApplicationConfiguration application,
IGApplicationConfiguration.IGPortInfo portInfo) |
Builds server channel configuration from the given application configuration information.
Resulting Endpoint will contain all the configuration information, so, it's enough to use something like:
|
static Endpoint |
createListeningEndpoint(IGApplicationConfiguration application,
IGApplicationConfiguration.IGPortInfo portInfo,
boolean tlsEnabled,
javax.net.ssl.SSLContext sslContext,
SSLExtendedOptions sslOptions) |
Builds server channel configuration from the given application configuration information.
|
public static Endpoint createListeningEndpoint(IGApplicationConfiguration application, IGApplicationConfiguration.IGPortInfo portInfo) throws ConfigurationException
Endpoint endpoint = ServerConfigurationHelper.createListeningEndpoint(
appConfig, appConfig.getPortInfo("default")
);
ExternalServiceProtocolListener serverChannel =
new ExternalServiceProtocolListener(endpoint);
...
application
- main application configurationportInfo
- configuration of particular port from the applicationConfigurationException
- is thrown in case of problems in the given application configurationpublic static Endpoint createListeningEndpoint(IGApplicationConfiguration application, IGApplicationConfiguration.IGPortInfo portInfo, boolean tlsEnabled, javax.net.ssl.SSLContext sslContext, SSLExtendedOptions sslOptions) throws ConfigurationException
final IGApplicationConfiguration.IGPortInfo portConfig = appConfig.getPortInfo("secure");
// TLS preparation section follows
final ITLSConnectionConfiguration tlsConfiguration = new TLSConnectionConfiguration();
TLSConfigurationParser.parseServerTLSConfiguration(appConfiguration, portConfig, tlsConfiguration);
// TLS customization code goes here...
// As an example, mutual TLS mode is turned on
tlsConfiguration.setTLSMutual(true);
// Get TLS configuration objects for connection
final SSLContext serverSSLContext = TLSConfigurationHelper.createSSLContext(tlsConfiguration);
final SSLExtendedOptions serverSSLOptions =
TLSConfigurationHelper.createSSLExtendedOptions(tlsConfiguration);
final boolean serverTLSEnabled = true;
// TLS preparation section ends
Endpoint endpoint = ServerConfigurationHelper.createListeningEndpoint(
appConfig, portConfig,
serverTLSEnabled, serverSSLContext, serverSSLOptions
);
ExternalServiceProtocolListener serverChannel =
new ExternalServiceProtocolListener(endpoint);
...
application
- main application configurationportInfo
- configuration of particular port from the applicationtlsEnabled
- if set to true
, TLS is enabled for the server socket;
if set to false
, TLS will not be used.sslContext
- TLS configuration to be used with this Endpoint. Can be null if TLS will not be used.sslOptions
- Additional TLS options to be used with this Endpoint. Can be null if TLS will not be used.ConfigurationException
- is thrown in case of problems in the given application configurationSend comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.