AsyncChannel
, AsyncChannelOperations
, AsyncInvokerSupport
, Channel
, ChannelListenerSupport
, ConfigurationSupport
, ConnectionInvokerSupport
, EndpointSupport
, InputChannel
, InterceptorSupport
, LogMessageFilterSupport
, MessageReceiver
, MessageReceiverManagement
, OutputChannel
, Protocol
, ProtocolDescriptionSupport
, Receiver
, ReceiverManagement
, RequestChannel
, MessageServerProtocolHandshakeOptions
@Tag(sdkName="Management", protocolName="MessageServer") public class MessageServerProtocol extends ClientChannel implements MessageServerProtocolHandshakeOptions
MessageServerProtocol
object to establish
communication between a client application and Genesys Message Server.
Here is a sample of how to establish communication with Message Server:
MessageServerProtocol msgProtocol =
new MessageServerProtocol(
new Endpoint(
msgEPName,
msgHost,
msgPort));
msgProtocol.setClientName(clientName);
msgProtocol.setClientId(clientDbid);
msgProtocol.setClientType(clientType);
msgProtocol.setClientHost(clientHost);
msgProtocol.open();
Sample code for sending log message to the Message Server:
RequestLogMessage request = RequestLogMessage.create();
request.setEntryId(30302);
request.setEntryText("alarm from test app");
request.setEntryCategory(LogCategory.Application);
request.setLevel(LogLevel.Alarm);
msgProtocol.send(request);
When you are finished communicating with the server, you can close the
channel like this:
msgProtocol.close();
Note: Starting from Platform SDK 8.5.0 version, main protocol channel classes
(including MessageServerProtocol
) are no longer "final
".AbstractChannel.AsyncErrorNotifier
ClientChannel.BasicClientHandshakeStep, ClientChannel.ClientHandshakeStep, ClientChannel.RegistrationHandler, ClientChannel.SimpleRegistrationHandler
Modifier and Type | Field | Description |
---|---|---|
static ProtocolDescription |
PROTOCOL_DESCRIPTION |
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
messageFilter
DEF_INPUT_SIZE
Constructor | Description |
---|---|
MessageServerProtocol() |
Creates a new
MessageServerProtocol object. |
MessageServerProtocol(Endpoint endpoint) |
Creates a new
MessageServerProtocol object. |
MessageServerProtocol(Endpoint endpoint,
long timeout) |
Creates a new
MessageServerProtocol object. |
Modifier and Type | Method | Description |
---|---|---|
protected Connection |
createConnection(Endpoint endpoint) |
|
java.lang.String |
getClientHost() |
Returns client host.
|
int |
getClientId() |
Gets identification number of log records' source.
By design it is DBID of client CME application. |
java.lang.String |
getClientName() |
Returns the Message Server client name for connection handshake procedure.
|
int |
getClientType() |
Returns type of application to be used in the logs.
|
protected void |
onOpen() |
This method is called when channel is opened and just about
to call event handler.
|
protected void |
onReceiveMessage(Message message) |
Gives to subclass a chance to perform some operations on incoming
message arrival before delivering it to connection user code.
|
protected void |
onSend(Message message) |
Gives to subclass a chance to modify message before sending it
to remote party.
|
void |
setClientHost(java.lang.String host) |
Sets client host to pass to server.
This value will be automatically attached to LogMessage before send if message does not declare own value. |
void |
setClientId(int clientId) |
Deprecated.
|
void |
setClientId(java.lang.Integer clientId) |
Sets identification number of log records' source.
By design it is DBID of client CME application. This value will be automatically attached to all LogMessages before send if it is not null. |
void |
setClientName(java.lang.String clientName) |
Sets the Message Server client name for connection handshake procedure.
|
void |
setClientType(int clientType) |
Sets type of application to be used in the logs.
|
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, getServerContext, 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, 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, createConnectionClosedEvent, doBeginClose, doClose, doSend, downgradeConnection, getConnectionClosedCause, 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, 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 MessageServerProtocol()
MessageServerProtocol
object.public MessageServerProtocol(Endpoint endpoint)
MessageServerProtocol
object.endpoint
- The endpoint (server) you wish to connect to.public MessageServerProtocol(Endpoint endpoint, long timeout)
MessageServerProtocol
object.endpoint
- The endpoint (server) you wish to connect to.timeout
- default channel timeout.public int getClientId()
getClientId
in interface MessageServerProtocolHandshakeOptions
public void setClientId(int clientId)
setClientId(Integer)
public void setClientId(java.lang.Integer clientId)
setClientId
in interface MessageServerProtocolHandshakeOptions
clientId
- client identification numberpublic java.lang.String getClientName()
getClientName
in interface MessageServerProtocolHandshakeOptions
setClientName(String)
public void setClientName(java.lang.String clientName)
setClientName
in interface MessageServerProtocolHandshakeOptions
clientName
- client namepublic int getClientType()
getClientType
in interface MessageServerProtocolHandshakeOptions
setClientType(int)
public void setClientType(int clientType)
setClientType
in interface MessageServerProtocolHandshakeOptions
clientType
- application typepublic java.lang.String getClientHost()
getClientHost
in interface MessageServerProtocolHandshakeOptions
setClientHost(String)
,
RequestLogMessage.setClientHost(String)
public void setClientHost(java.lang.String host)
setClientHost
in interface MessageServerProtocolHandshakeOptions
host
- client hostRequestLogMessage.setClientHost(String)
protected void onSend(Message message) throws ProtocolException
DuplexChannel
onSend
in class ClientChannel
message
- Message to modifyProtocolException
- In the case of an unrecoverable protocol error. Client applications should not
try to deal with these exceptions, except for logging or displaying to users or technical administrators.
Check the exception cause for more details.protected void onReceiveMessage(Message message)
DuplexChannel
onReceiveMessage
in class ClientChannel
message
- received messageprotected Connection createConnection(Endpoint endpoint)
createConnection
in class DuplexChannel
protected void onOpen() throws ProtocolException
DuplexChannel
onOpen
in class ClientChannel
ProtocolException
- if there are problems during
post open operations (e.g. registration)Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.