AsyncChannel
, AsyncChannelOperations
, AsyncInvokerSupport
, Channel
, ChannelListenerSupport
, ConfigurationSupport
, ConnectionInvokerSupport
, EndpointSupport
, InputChannel
, InterceptorSupport
, LogMessageFilterSupport
, MessageReceiver
, MessageReceiverManagement
, OutputChannel
, Protocol
, ProtocolDescriptionSupport
, Receiver
, ReceiverManagement
, RequestChannel
, InteractionServerProtocolHandshakeOptions
@Tag(sdkName="OpenMedia", protocolName="InteractionServer") public class InteractionServerProtocol extends ClientChannel implements InteractionServerProtocolHandshakeOptions
InteractionServerProtocol
object to establish
communication between an agent application (or other client application)
and Interaction Server.
For example, if you wanted to write an agent-facing application to
handle Open Media interactions, you could set up an InteractionServerProtocol
object and establish communication with the server in this way:
InteractionServerProtocol interactionServerProtocol =
new InteractionServerProtocol(
new Endpoint(
endpointName,
interactionServerHost,
interactionServerPort));
interactionServerProtocol.setClientType(InteractionClient.AgentApplication);
interactionServerProtocol.open();
When you were finished communicating with the server, you could close the
channel like this:
interactionServerProtocol.close();
Here is a sample of how to open a connection to Interaction Server and create
a new interaction with attached data:
InteractionServerProtocol interactionServerProtocol =
new InteractionServerProtocol(
new Endpoint("InteractionServer", host, port));
interactionServerProtocol.setClientName("EntityListener");
interactionServerProtocol.
setClientType(InteractionClient.MediaServer);
KeyValueCollection userData =
new KeyValueCollection();
userData.addObject("crmactivityid", activityid);
userData.addObject("crmactivitytype", activitytype);
try {
interactionServerProtocol.open();
RequestSubmit requestSubmit = RequestSubmit.create(
interactionServerProtocol.getProxyId(),
null,
null,
inboundQueue,
tenantID,
"crmemail",
"Inbound",
"InboundNew",
true,
new Date(),
userData,
null,
inQueues,
outQueues);
Message response =
interactionServerProtocol.request(requestSubmit);
writeToLog("Response: " + response.messageName());
} catch(Exception exception) {
writeToLog(
"Exception while sending request to interaction server: "
+ exception.getMessage());
}
Note: Starting from Platform SDK 8.5.0 version, main protocol channel classes
(including InteractionServerProtocol
) are no longer "final
".AbstractChannel.AsyncErrorNotifier
ClientChannel.BasicClientHandshakeStep, ClientChannel.ClientHandshakeStep, ClientChannel.RegistrationHandler, ClientChannel.SimpleRegistrationHandler
Modifier and Type | Field | Description |
---|---|---|
static ProtocolDescription |
PROTOCOL_DESCRIPTION |
Protocol signature (sdk and name) for this Channel.
|
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
messageFilter
DEF_INPUT_SIZE
Constructor | Description |
---|---|
InteractionServerProtocol() |
Creates channel to Interaction server.
|
InteractionServerProtocol(Endpoint endpoint) |
Creates channel to Interaction server.
|
InteractionServerProtocol(Endpoint endpoint,
long timeout) |
Creates channel to Interaction server.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Integer |
createReference() |
Creates the next reference.
|
java.lang.String |
getClientName() |
Returns the name of a client.
|
InteractionClient |
getClientType() |
Returns the type of a client.
|
java.lang.String |
getMediaType() |
Returns the type of media.
|
java.lang.Integer |
getProxyId() |
Returns the proxy id.
|
KeyValueCollection |
getRegistrationExtensions() |
Returns extended parameters of registration.
|
InteractionServerContext |
getServerContext() |
Returns server context.
|
protected void |
onClose(ConnectionClosedEvent event) |
|
protected void |
onOpen() |
This method is called when channel is opened and just about
to call event handler.
|
void |
setClientName(java.lang.String nameOfClient) |
Sets the name of a client.
|
void |
setClientType(InteractionClient typeOfClient) |
Sets the type of a client.
|
void |
setMediaType(java.lang.String value) |
Sets the type of media.
|
void |
setProxyId(java.lang.Integer idOfProxy) |
Sets the id of the proxy.
|
void |
setRegistrationExtensions(KeyValueCollection registrationExt) |
Sets extended parameters of registration.
|
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, getState, getStateMods, getTimeout, getTimer, internal, onSetEndpoint, releaseDefaultInvoker, removeChannelListener, setConfiguration, setInvoker, setServerContext, setState, setTimeout, throwNotClosed, throwNotOpened, throwNotOpenedOnClose, throwNotOpenedOnSend, throwNull, throwNullEndpoint
getState
setInvoker
close, getTimeout, open, setTimeout
addChannelListener, removeChannelListener
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
configure, getConfiguration
setConnectionInvoker
addListener, applyConfiguration, cancelCloseTimeout, cancelOpenTimeout, clearInput, close, closeAsync, createChannelClosedEvent, createConnection, createConnectionClosedEvent, doBeginClose, doClose, doSend, downgradeConnection, getConnectionClosedCause, getDefaultRestriction, getEnpointPrefixInfo, getInputSize, getInterceptor, getLocalEndPoint, getLocalEndpointInfo, getLogMessageFilter, getProtocolDescription, getProtocolFactory, getProtocolId, getRemoteEndPoint, getTimeoutException, initPackager, isMessageAllowed, notifyWithObject, 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, wrapInProtocolException
getEndpoint
setMessageHandler
getInterceptor
receive, receive
setReceiver
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, removeListener, send
getProtocolId
getProtocolDescription
clearInput, getInputSize, releaseReceivers, setInputSize
resetReceiver
public static final ProtocolDescription PROTOCOL_DESCRIPTION
public InteractionServerProtocol(Endpoint endpoint, long timeout)
endpoint
- Parameters of the connection to createtimeout
- Timeout to wait for message (in milliseconds)public InteractionServerProtocol(Endpoint endpoint)
endpoint
- Parameters of the connection to createpublic InteractionServerProtocol()
public java.lang.Integer createReference()
public InteractionClient getClientType()
getClientType
in interface InteractionServerProtocolHandshakeOptions
setClientType(InteractionClient)
public void setClientType(InteractionClient typeOfClient)
setClientType
in interface InteractionServerProtocolHandshakeOptions
typeOfClient
- type of clientpublic java.lang.String getClientName()
getClientName
in interface InteractionServerProtocolHandshakeOptions
setClientName(String)
public void setClientName(java.lang.String nameOfClient)
setClientName
in interface InteractionServerProtocolHandshakeOptions
nameOfClient
- name of clientpublic java.lang.String getMediaType()
getMediaType
in interface InteractionServerProtocolHandshakeOptions
setMediaType(String)
public void setMediaType(java.lang.String value)
setMediaType
in interface InteractionServerProtocolHandshakeOptions
value
- type of mediapublic java.lang.Integer getProxyId()
getProxyId
in interface InteractionServerProtocolHandshakeOptions
setProxyId(Integer)
,
getServerContext()
,
InteractionServerContext.getProxyId()
public void setProxyId(java.lang.Integer idOfProxy)
setProxyId
in interface InteractionServerProtocolHandshakeOptions
idOfProxy
- id of the proxypublic KeyValueCollection getRegistrationExtensions()
getRegistrationExtensions
in interface InteractionServerProtocolHandshakeOptions
setRegistrationExtensions(KeyValueCollection)
,
getServerContext()
,
InteractionServerContext.getRegistrationExtensions()
public void setRegistrationExtensions(KeyValueCollection registrationExt)
setRegistrationExtensions
in interface InteractionServerProtocolHandshakeOptions
registrationExt
- registration extensionsgetRegistrationExtensions()
,
getServerContext()
,
InteractionServerContext.getRegistrationExtensions()
public InteractionServerContext getServerContext()
getServerContext
in class AbstractChannel
protected void onOpen() throws ProtocolException
DuplexChannel
onOpen
in class ClientChannel
ProtocolException
- if there are problems during
post open operations (e.g. registration)protected void onClose(ConnectionClosedEvent event)
onClose
in class DuplexChannel
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.