|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.commons.protocol.AbstractChannel
com.genesyslab.platform.commons.protocol.DuplexChannel
com.genesyslab.platform.commons.protocol.ClientChannel
com.genesyslab.platform.openmedia.protocol.InteractionServerProtocol
@ProtocolDescription.Tag(sdkName="OpenMedia", protocolName="InteractionServer") public class InteractionServerProtocol
Use an InteractionServerProtocol
object to establish
communication between an agent application (or other client application)
and Interaction Server.
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
".
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 ProtocolDescription |
PROTOCOL_DESCRIPTION
Protocol signature (sdk and name) for this Channel. |
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 | |
---|---|
InteractionServerProtocol()
Creates channel to Interaction server. |
|
InteractionServerProtocol(Endpoint endpoint)
Creates channel to Interaction server. |
|
InteractionServerProtocol(Endpoint endpoint,
long timeout)
Creates channel to Interaction server. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.genesyslab.platform.commons.protocol.AbstractChannel |
---|
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, 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 |
Field Detail |
---|
public static final ProtocolDescription PROTOCOL_DESCRIPTION
Constructor Detail |
---|
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()
Method Detail |
---|
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
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |