Platform SDK Java 8.5 API Reference

com.genesyslab.platform.voice.protocol
Class TServerProtocol

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.voice.protocol.TServerProtocol
All Implemented Interfaces:
AsyncChannel, AsyncChannelOperations, AsyncInvokerSupport, Channel, ChannelListenerSupport, ConfigurationSupport, ConnectionInvokerSupport, EndpointSupport, InputChannel, InterceptorSupport, LogMessageFilterSupport, MessageReceiver, MessageReceiverManagement, OutputChannel, Protocol, ProtocolDescriptionSupport, Receiver, ReceiverManagement, RequestChannel, TServerProtocolHandshakeOptions

@ProtocolDescription.Tag(sdkName="Voice",
                         protocolName="TServer")
public class TServerProtocol
extends ClientChannel
implements TServerProtocolHandshakeOptions

Use a TServerProtocol object to establish communication between a client application and TServer.

Here is a sample of how to establish communication with TServer:

 TServerProtocol tserverProtocol =
   new TServerProtocol(
     new Endpoint(
       tserverEPName,
       host,
       port));
 tserverProtocol.setClientName(clientName);
 tserverProtocol.open();
 
When you are finished communicating with the server, you can close the channel like this:
 tserverProtocol.close();
 

Note: Starting from Platform SDK 8.5.0 version, main protocol channel classes (including TServerProtocol) 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
static java.lang.String APP_NAME_KEY
          Key for application name (used in T-Server logs).
static java.lang.String BACKUP_RECONNECT_INTERVAL_KEY
          Key for HA backup reconnection interval (THA_BRC_INTERVAL).
static java.lang.String PASS_KEY
           
static ProtocolDescription PROTOCOL_DESCRIPTION
          Protocol signature (sdk and name) for this Channel.
static java.lang.String SWITCHOVER_TIMEOUT_KEY
          Key for HA switchover timeout (THA_SWO_TIMEOUT).
 
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
TServerProtocol()
          Creates instance of TServerProtocol.
TServerProtocol(Endpoint endpoint)
          Creates instance of TServerProtocol.
TServerProtocol(Endpoint endpoint, long timeout)
          Creates instance of TServerProtocol.
 
Method Summary
protected  Connection createConnection(Endpoint endpoint)
           
 java.lang.String getClientName()
          Returns client application name.
 java.lang.String getClientPassword()
          Returns optional client application password.
 KeyValuePrinter getTKVPrinter()
           
protected  void onSetEndpoint(Endpoint endpoint)
          This method is notified before setting a endpoint to the channel.
 void setClientName(java.lang.String appName)
          Sets client application name.
 void setClientPassword(java.lang.String pass)
          Sets optional client application password.
 void setLogMessageFilter(MessageFilter filter)
          Sets current message logining filter.
 void setTKVPrinter(KeyValuePrinter printer)
           
 
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, onOpen, 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, 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, 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, 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
 

Field Detail

PROTOCOL_DESCRIPTION

public static final ProtocolDescription PROTOCOL_DESCRIPTION
Protocol signature (sdk and name) for this Channel.


APP_NAME_KEY

public static final java.lang.String APP_NAME_KEY
Key for application name (used in T-Server logs).

See Also:
Constant Field Values

PASS_KEY

public static final java.lang.String PASS_KEY
See Also:
Constant Field Values

SWITCHOVER_TIMEOUT_KEY

public static final java.lang.String SWITCHOVER_TIMEOUT_KEY
Key for HA switchover timeout (THA_SWO_TIMEOUT). Timeout is in milliseconds. Default value is 3600 (3.6 sec)

See Also:
Constant Field Values

BACKUP_RECONNECT_INTERVAL_KEY

public static final java.lang.String BACKUP_RECONNECT_INTERVAL_KEY
Key for HA backup reconnection interval (THA_BRC_INTERVAL). Timeout is in milliseconds. Default value is 3600 (3.6 sec)

See Also:
Constant Field Values
Constructor Detail

TServerProtocol

public TServerProtocol(Endpoint endpoint,
                       long timeout)
Creates instance of TServerProtocol.

Parameters:
endpoint - Parameters of the connection to create
timeout - Timeout to wait for message (in milliseconds)

TServerProtocol

public TServerProtocol(Endpoint endpoint)
Creates instance of TServerProtocol.

Parameters:
endpoint - Parameters of the connection to create

TServerProtocol

public TServerProtocol()
Creates instance of TServerProtocol.

Method Detail

setTKVPrinter

public void setTKVPrinter(KeyValuePrinter printer)

getTKVPrinter

public KeyValuePrinter getTKVPrinter()

onSetEndpoint

protected void onSetEndpoint(Endpoint endpoint)
Description copied from class: AbstractChannel
This method is notified before setting a endpoint to the channel.

Overrides:
onSetEndpoint in class AbstractChannel
Parameters:
endpoint - new endpoint

setClientName

public void setClientName(java.lang.String appName)
Sets client application name. It's used then in logs of TServer. Note that it can be set via ConnectionConfiguration instance, but this method has greater priority.

Specified by:
setClientName in interface TServerProtocolHandshakeOptions
Parameters:
appName - Client application name

getClientName

public java.lang.String getClientName()
Returns client application name. It's used then in logs of TServer. Note that it can be set via ConnectionConfiguration instance.

Specified by:
getClientName in interface TServerProtocolHandshakeOptions
Returns:
Client application name
See Also:
setClientName(String)

setClientPassword

public void setClientPassword(java.lang.String pass)
Sets optional client application password.

Specified by:
setClientPassword in interface TServerProtocolHandshakeOptions
Parameters:
pass - application password

getClientPassword

public java.lang.String getClientPassword()
Returns optional client application password.

Specified by:
getClientPassword in interface TServerProtocolHandshakeOptions
Returns:
application password or null
See Also:
setClientPassword(String)

createConnection

protected Connection createConnection(Endpoint endpoint)
Overrides:
createConnection in class DuplexChannel

setLogMessageFilter

public void setLogMessageFilter(MessageFilter filter)
Description copied from interface: LogMessageFilterSupport
Sets current message logining filter.

Specified by:
setLogMessageFilter in interface LogMessageFilterSupport
Overrides:
setLogMessageFilter in class DuplexChannel
Parameters:
filter - new message logining filter.

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.