Platform SDK Java 8.5 API Reference

com.genesyslab.platform.contacts.protocol
Class UniversalContactServerProtocolListener

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.AbstractChannel
      extended by com.genesyslab.platform.commons.protocol.ServerChannel
          extended by com.genesyslab.platform.contacts.protocol.UniversalContactServerProtocolListener
All Implemented Interfaces:
AsyncChannel, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, OutputChannel, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestReceiver, RequestReceiverManagement, ResponseChannel

public class UniversalContactServerProtocolListener
extends ServerChannel

Customized ServerChannel component for handling of Genesys Universal Contact Server protocol clients.
Here is a simple example of synchronous server side procedure:

 int LISTEN_PORT = 12020;
 UniversalContactServerProtocolListener contactSrvChannel = new UniversalContactServerProtocolListener(
         new WildcardEndpoint("ContactServer", LISTEN_PORT));
 colntactSrvChannel.setClientRequestHandler(new ClientRequestHandler() {
         public void processRequest(final RequestContext context) {
             final Message request = context.getRequestMessage();
             Integer refId = null;
             if (request instanceof Referenceable) {
                 refId = (Integer) ((Referenceable) request).retreiveReference();
             }
             Message response = null;

             // Do handle the 'request' and create 'response' for it...

             if (response != null) {
                 if ((refId != null) && (response instanceof Referenceable)) {
                     ((Referenceable) response).updateReference(refId);
                 }
                 try {
                     context.respond(response);
                 } catch (final ProtocolException ex) {
                     // handle the exception
                 }
             }
         }});
 contactSrvChannel.open();
 
Note1: It's also possible to do asynchronous server requests handling. The RequestContext may be passed to some asynchronous task, and than handled and responded in a user defined executor service.
Note2: Universal Contact Server protocol has own mandatory handshake procedure. So, to let client connections be able to get opened, the server channel listener has to have proper implementation of ClientRequestHandler with handling of the UCS registration requests.

See Also:
UniversalContactServerProtocol

Nested Class Summary
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
AbstractChannel.AsyncErrorNotifier
 
Field Summary
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Channel
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Receiver
DEF_INPUT_SIZE
 
Constructor Summary
UniversalContactServerProtocolListener(Endpoint endpoint)
           
 
Method Summary
 
Methods inherited from class com.genesyslab.platform.commons.protocol.ServerChannel
addListener, applyConfiguration, beginClose, beginOpen, clearInput, close, close, closeClientChannels, closeListener, getChannels, getInputSize, getLocalEndPoint, getProtocolDescription, getProtocolFactory, modifyNewChannel, open, open, receive, receive, receiveRequest, receiveRequest, releaseReceivers, removeListener, resetReceiver, send, sendToChannelsExcept, sendToChannelsExcept, setClientRequestHandler, setInputSize, setReceiver
 
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
addChannelListener, configure, connectionContext, copyTLSSettings, createChannelClosedEvent, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getEnpointPrefixInfo, getInvoker, getListenerHelper, getLocalEndpointInfo, getServerContext, getState, getStateMods, getTimeout, internal, onFireClosed, onFireErrorEvent, onFireOpened, onSetEndpoint, releaseDefaultInvoker, removeChannelListener, setConfiguration, setConnectionInvoker, setEndpoint, setInvoker, setServerContext, setState, setState, setTimeout, throwNotClosed, throwNotOpened, throwNotOpenedOnClose, throwNotOpenedOnSend, throwNull, throwNullEndpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel
getTimeout, setTimeout
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncChannel
getState
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ChannelListenerSupport
addChannelListener, removeChannelListener
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.EndpointSupport
getEndpoint, setEndpoint
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ConfigurationSupport
configure, getConfiguration
 

Constructor Detail

UniversalContactServerProtocolListener

public UniversalContactServerProtocolListener(Endpoint endpoint)

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.