Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.configuration
Class ServerConfigurationHelper

java.lang.Object
  extended by com.genesyslab.platform.apptemplate.configuration.ServerConfigurationHelper

public class ServerConfigurationHelper
extends java.lang.Object

Helper class for 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 Summary
ServerConfigurationHelper()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerConfigurationHelper

public ServerConfigurationHelper()
Method Detail

createListeningEndpoint

public static Endpoint createListeningEndpoint(IGApplicationConfiguration application,
                                               IGApplicationConfiguration.IGPortInfo portInfo)
                                        throws ConfigurationException
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:
  Endpoint endpoint = ServerConfigurationHelper.createListeningEndpoint(
                              appConfig, appConfig.getPortInfo("default")
                      );
  ExternalServiceProtocolListener serverChannel =
                      new ExternalServiceProtocolListener(endpoint);
  ...
 

Parameters:
application - main application configuration
portInfo - configuration of particular port from the application
Returns:
new instance of "local" Endpoint to listen on with attached connection configuration
Throws:
ConfigurationException - is thrown in case of problems in the given application configuration

createListeningEndpoint

public static Endpoint createListeningEndpoint(IGApplicationConfiguration application,
                                               IGApplicationConfiguration.IGPortInfo portInfo,
                                               boolean tlsEnabled,
                                               javax.net.ssl.SSLContext sslContext,
                                               SSLExtendedOptions sslOptions)
                                        throws ConfigurationException
Builds server channel configuration from the given application configuration information. Allows to turn on TLS for the server channel.
Resulting Endpoint will contain all the configuration information, so, it's enough to use something like:

 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);
 ...
 

Parameters:
application - main application configuration
portInfo - configuration of particular port from the application
tlsEnabled - 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.
Returns:
new instance of "local" Endpoint to listen on with attached connection configuration
Throws:
ConfigurationException - is thrown in case of problems in the given application configuration

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.