|
Configuration Platform SDK 7.6 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.DataObject
com.genesyslab.platform.commons.protocol.Message
This abstract class provides the interface used for all Event
classes. When events are received from a server, your application will use
this interface to process them.
interactionServerProtocol.send(requestAgentLogin);
Message response = interactionServerProtocol.receive();
send()
and receive()
methods into a single method call by using the request()
method, like this:
Message response =
interactionServerProtocol.request(requestAgentLogin);
Message unsolicitedEvent = interactionServerProtocol.receive();
Message
. This is the interface implemented by all
events in the Platform SDK. Some requests will be answered by an event that is
specific to the request, while others will receive a more generic response of
EventAck
, which simply acknowledges that your request was
successful. If a request fails, the server will send an EventError
.
RequestAgentLogin
, for example, will receive an
EventAck
, while an unsuccessful one will receive an
EventError
. You can use a switch statement to test which response
you received, as outlined here:
switch(response.messageId())
{
case EventAck.ID:
// The request succeeded, carry out appropriate processing...
case EventError.ID:
// The request failed, carry out appropriate processing...
...
}
Method Summary | |
Message |
cloneMessage()
|
abstract Endpoint |
getEndpoint()
Indicates server URI from which current message has been received. |
abstract java.lang.Object |
getMessageAttribute(java.lang.String index)
Return message attribute as object by specified index. |
ProtocolDescription |
getProtocolDescription()
|
abstract int |
getProtocolId()
Return hash code of protocol object which handled the message. |
int |
messageId()
Return message id |
java.lang.String |
messageName()
Return message name |
Methods inherited from class com.genesyslab.platform.commons.protocol.DataObject |
equals, hashCode, toString, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public int messageId()
public java.lang.String messageName()
public abstract java.lang.Object getMessageAttribute(java.lang.String index)
index
- index of attribute
public abstract int getProtocolId()
public ProtocolDescription getProtocolDescription()
getProtocolDescription
in interface ProtocolDescriptionSupport
public abstract Endpoint getEndpoint()
public Message cloneMessage()
|
Configuration Platform SDK 7.6 API Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |