Platform SDK Java 8.5 API Reference

com.genesyslab.platform.management.protocol
Class SolutionControlServerProtocol

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.AbstractChannel
      extended by com.genesyslab.platform.commons.protocol.DuplexChannel
          extended by com.genesyslab.platform.commons.protocol.ClientChannel
              extended by com.genesyslab.platform.management.protocol.SolutionControlServerProtocol
All Implemented Interfaces:
AsyncChannel, AsyncChannelOperations, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, InputChannel, InterceptorSupport, LogMessageFilterSupport, MessageReceiver, MessageReceiverManagement, OutputChannel, Protocol, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestChannel, SolutionControlServerProtocolHandshakeOptions

@ProtocolDescription.Tag(sdkName="Management",
                         protocolName="SolutionControlServer")
public class SolutionControlServerProtocol
extends ClientChannel
implements SolutionControlServerProtocolHandshakeOptions

Use an SolutionControlServerProtocol object to establish communication between an agent application (or other client application) and Solution ControlServer.

Here is the sample of how to open connection to Solution Control Server and retrieve actual information about application.

 SolutionControlServerProtocol protocol =
       new SolutionControlServerProtocol(
               new Endpoint(name, host, port));
 protocol.open();

 RequestApplicationInfo rai = RequestApplicationInfo.create();

 // Application clientId which status we want to know

 rai.setControlObjectId(applicationId);

 try {
     EventInfo responce = (EventInfo) protocol.request(rai);
     WriteToLog(responce.Name);
 } catch (Exception exception) {
     WriteToLog(
             "Exception while sending request to interaction server: "
             + exception);
 }

 protocol.close();
 

If you want to receive notifications from Solution Control Server about application status changing you should execute subscribe request.

 RequestSubscribe rs = RequestSubscribe.create();
 rs.setControlObjectId(applicationId);
 rs.setControlObjectType(ControlObjectType.Application);

 Message msg = protocol.request(rs);
 

After subscribe you can listen SCS for notifications:

 Message recMsg = protocol.receive();
 if (recMsg instanceof EventInfo) {
     WriteToLog("Current status: " + ((EventInfo) recMsg).getDescription());
 }
 

Note: Starting from Platform SDK 8.5.0 version, main protocol channel classes (including SolutionControlServerProtocol) are no longer "final".
It helps with applications unit testing. At the same time it opens access and allows to override protocols internal protected staff from custom child classes.
Changes or extensions of the protocols functionality in child classes must be done very carefully with clear understanding of affected components and functionality.
Also, protected PSDK methods and elements are not a part of public API, and may be a subject for changes without special notice. So, application, which uses or overrides internal/protected staff, may have compatibility issues on PSDK update.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.protocol.ClientChannel
ClientChannel.BasicClientHandshakeStep, ClientChannel.ClientHandshakeStep, ClientChannel.RegistrationHandler, ClientChannel.SimpleRegistrationHandler
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
AbstractChannel.AsyncErrorNotifier
 
Field Summary
 
Fields inherited from class com.genesyslab.platform.commons.protocol.DuplexChannel
messageFilter
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Receiver
DEF_INPUT_SIZE
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Channel
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
 
Constructor Summary
SolutionControlServerProtocol()
          Creates a new SolutionControlServerProtocol object.
SolutionControlServerProtocol(Endpoint endpoint)
          Creates a new SolutionControlServerProtocol object.
 
Method Summary
 int getClientId()
          Returns client application DBID.
 java.lang.String getClientName()
          Returns client application name.
 ControlObjectType getClientType()
          Returns SCS client type.
Default value is ControlObjectType.Application.
 int getConnectCode()
           
 ControlObjectType getControlObjectType()
          Deprecated.  
 java.lang.String getUserName()
          Returns user name handshake property.
protected  void onOpen()
          This method is called when channel is opened and just about to call event handler.
 void setClientId(int value)
          Sets client application DBID.
 void setClientName(java.lang.String value)
          Sets client application name.
 void setClientType(ControlObjectType value)
          Sets SCS client type.
Default value is ControlObjectType.Application.
 void setControlObjectType(ControlObjectType value)
          Deprecated.  
 void setUserName(java.lang.String value)
          Sets user name handshake property.
 
Methods inherited from class com.genesyslab.platform.commons.protocol.ClientChannel
beginClose, beginOpen, beginRequest, close, close, closeAsync, closeAsync, disableConnectionOperations, doBeginRequest, doBeginRequest, doRequest, endRequest, endRequest, fireUnsolicitedEvents, getCopyResponse, getInvoker, getOpenTimeoutException, getReferenceBuilder, onReceiveMessage, onSend, onUnexpectedHandshakeMessage, open, openAsync, openAsync, request, request, requestAsync, requestAsync, setAddressResolver, setAddressResolverParams, setAddressResolverParams, setCopyResponse, setEndpoint, setHandshakeFinished, setHandshakePhase, setHandshakeUnsolicitedEventsPassLimit, setRegistrationHandler, setState, submitRegMessage, throwOnUnReferenceableRequest
 
Methods inherited from class com.genesyslab.platform.commons.protocol.DuplexChannel
addListener, applyConfiguration, cancelCloseTimeout, cancelOpenTimeout, clearInput, close, closeAsync, createChannelClosedEvent, createConnection, createConnectionClosedEvent, doBeginClose, doClose, doSend, downgradeConnection, getDefaultRestriction, getEnpointPrefixInfo, getInputSize, getInterceptor, getLocalEndPoint, getLocalEndpointInfo, getLogMessageFilter, getProtocolDescription, getProtocolFactory, getProtocolId, getRemoteEndPoint, getTimeoutException, initPackager, isMessageAllowed, notifyWithObject, onClose, onFireClosed, onFireErrorEvent, onFireOpened, open, openAsync, openAsync, processClose, processCloseAll, receive, receive, receivedMessage, releaseReceivers, removeListener, resetReceiver, resumeReading, send, setConnectionInvoker, setExternalTransport, setInputSize, setLogMessageFilter, setMessageHandler, setProtocolData, setReceiver, startUpgradeConnection, stopReading, toString, triggerWithObject, upgradeConnection, waitForObject
 
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, getServerContext, getState, getStateMods, getTimeout, internal, onSetEndpoint, releaseDefaultInvoker, removeChannelListener, setConfiguration, setInvoker, setServerContext, setState, setTimeout, throwNotClosed, throwNotOpened, throwNotOpenedOnClose, throwNotOpenedOnSend, throwNull, throwNullEndpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Protocol
getProtocolId
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.InputChannel
setMessageHandler
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.MessageReceiver
receive, receive
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Receiver
clearInput, getInputSize, releaseReceivers, setInputSize
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.OutputChannel
addListener, removeListener, send
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel
close, getTimeout, open, 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.InterceptorSupport
getInterceptor
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.MessageReceiverManagement
setReceiver
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ReceiverManagement
resetReceiver
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ConfigurationSupport
configure, getConfiguration
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.EndpointSupport
getEndpoint
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ProtocolDescriptionSupport
getProtocolDescription
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncInvokerSupport
setInvoker
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ConnectionInvokerSupport
setConnectionInvoker
 

Constructor Detail

SolutionControlServerProtocol

public SolutionControlServerProtocol()
Creates a new SolutionControlServerProtocol object.


SolutionControlServerProtocol

public SolutionControlServerProtocol(Endpoint endpoint)
Creates a new SolutionControlServerProtocol object.

Parameters:
endpoint - The endpoint (server) you wish to connect to.
Method Detail

getClientId

public int getClientId()
Returns client application DBID.

Specified by:
getClientId in interface SolutionControlServerProtocolHandshakeOptions
Returns:
application DBID
See Also:
setClientId(int)

setClientId

public void setClientId(int value)
Sets client application DBID.

Specified by:
setClientId in interface SolutionControlServerProtocolHandshakeOptions
Parameters:
clientId - client application DBID

getControlObjectType

public ControlObjectType getControlObjectType()
Deprecated. 

See Also:
getClientType()

setControlObjectType

public void setControlObjectType(ControlObjectType value)
Deprecated. 

See Also:
setClientType(ControlObjectType)

getConnectCode

public int getConnectCode()

getUserName

public java.lang.String getUserName()
Returns user name handshake property.

Specified by:
getUserName in interface SolutionControlServerProtocolHandshakeOptions
Returns:
user name
See Also:
setUserName(String)

setUserName

public void setUserName(java.lang.String value)
Sets user name handshake property.

Specified by:
setUserName in interface SolutionControlServerProtocolHandshakeOptions
Parameters:
userName - user name

getClientName

public java.lang.String getClientName()
Returns client application name.

Specified by:
getClientName in interface SolutionControlServerProtocolHandshakeOptions
Returns:
client application name
See Also:
setClientName(String)

setClientName

public void setClientName(java.lang.String value)
Sets client application name.

Specified by:
setClientName in interface SolutionControlServerProtocolHandshakeOptions
Parameters:
clientName - client application name

getClientType

public ControlObjectType getClientType()
Returns SCS client type.
Default value is ControlObjectType.Application.

Specified by:
getClientType in interface SolutionControlServerProtocolHandshakeOptions
Returns:
client type
See Also:
setClientType(ControlObjectType), ControlObjectType

setClientType

public void setClientType(ControlObjectType value)
Sets SCS client type.
Default value is ControlObjectType.Application.

Specified by:
setClientType in interface SolutionControlServerProtocolHandshakeOptions
Parameters:
clientType - client type
See Also:
ControlObjectType

onOpen

protected void onOpen()
               throws ProtocolException
Description copied from class: DuplexChannel
This method is called when channel is opened and just about to call event handler. You usually will need to add some logic here and call super.onOpen() at the end of your method. Please note, that calling super.onOpen() on the thread other then open() was called will most probably result in deadlock for some scenarios (like calling close() inside of onChannelOpened())

Overrides:
onOpen in class ClientChannel
Throws:
ProtocolException - if there are problems during post open operations (e.g. registration)

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.