|
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.management.protocol.MessageServerProtocol
@ProtocolDescription.Tag(sdkName="Management", protocolName="MessageServer") public class MessageServerProtocol
Use a MessageServerProtocol
object to establish
communication between a client application and Genesys 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
".
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 |
---|
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 | |
---|---|
MessageServerProtocol()
Creates a new MessageServerProtocol object. |
|
MessageServerProtocol(Endpoint endpoint)
Creates a new MessageServerProtocol object. |
|
MessageServerProtocol(Endpoint endpoint,
long timeout)
Creates a new MessageServerProtocol object. |
Method Summary | |
---|---|
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. |
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, 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.AbstractChannel |
---|
addChannelListener, configure, connectionContext, copyTLSSettings, fireClosed, fireErrorEvent, fireErrorEvent, generateChannelId, getChannelId, getConfiguration, getDefaultInvoker, getEndpoint, getListenerHelper, getServerContext, 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 |
Constructor Detail |
---|
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.Method Detail |
---|
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 modify
ProtocolException
- 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)
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |