com.genesyslab.platform.voice.protocol
Class TServerProtocol
java.lang.Object
com.genesyslab.platform.commons.protocol.AbstractChannel
com.genesyslab.platform.commons.protocol.DuplexChannel
com.genesyslab.platform.commons.protocol.ClientChannel
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.
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 |
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
TServerProtocol
public TServerProtocol(Endpoint endpoint,
long timeout)
- Creates instance of TServerProtocol.
- Parameters:
endpoint
- Parameters of the connection to createtimeout
- 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.
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.
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.