|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SIFMessagingListener
A MessagingListener that can be implemented to receive notification when
when SIF-related messaging activity takes place. An agent can register one
or more SIFMessagingListeners with Zone and Topic classes. In some cases a
listener instance can be directly passed to a method of those classes, such
as Zone.query and Topic.query, so that an
anonymous implementation of the listener can be used.
For all types of messages represented by this interface, the framework
calls the appropriate function both before and after a message is received
or sent to a zone. The messageType parameter will be a value defined
by the constants of this interface (e.g. SIF_EVENT).
| Field Summary | |
|---|---|
static byte |
SIF_EVENT
MessageType constant identifying a SIF_Event |
static byte |
SIF_PROVIDE
MessageType constant identifying a SIF_Provide |
static byte |
SIF_REGISTER
MessageType constant identifying a SIF_Register |
static byte |
SIF_REQUEST
MessageType constant identifying a SIF_Request |
static byte |
SIF_RESPONSE
MessageType constant identifying a SIF_Response |
static byte |
SIF_SUBSCRIBE
MessageType constant identifying a SIF_Subscribe |
static byte |
SIF_SYSTEM_CONTROL
MessageType constant identifying a SIF_SystemControl |
static byte |
SIF_UNPROVIDE
MessageType constant identifying a SIF_Unprovide |
static byte |
SIF_UNREGISTER
MessageType constant identifying a SIF_Unregister |
static byte |
SIF_UNSUBSCRIBE
MessageType constant identifying a SIF_Unsubscribe |
| Fields inherited from interface com.edustructures.sifworks.MessagingListener |
|---|
RX_DISCARD, RX_PROCESS, RX_REPARSE |
| Method Summary | |
|---|---|
void |
onMessageProcessed(byte messageType,
MessageInfo info)
Called when a SIF_Message has been received by the framework and successfully dispatched to the ADK's message handlers. |
byte |
onMessageReceived(byte messageType,
java.lang.StringBuffer message)
Called when a SIF_Message has been received by the framework, before it is dispatched to the ADK's message handlers. |
void |
onMessageSent(byte messageType,
MessageInfo info,
java.lang.Object ack)
Called when a SIF_Message has been sent by the framework and a SIF_Ack received from the server. |
boolean |
onSendingMessage(byte messageType,
MessageInfo info,
java.lang.StringBuffer message)
Called when a SIF_Message is about to be sent by the framework. |
| Field Detail |
|---|
static final byte SIF_EVENT
static final byte SIF_REQUEST
static final byte SIF_RESPONSE
static final byte SIF_SYSTEM_CONTROL
static final byte SIF_REGISTER
static final byte SIF_UNREGISTER
static final byte SIF_SUBSCRIBE
static final byte SIF_UNSUBSCRIBE
static final byte SIF_PROVIDE
static final byte SIF_UNPROVIDE
| Method Detail |
|---|
byte onMessageReceived(byte messageType,
java.lang.StringBuffer message)
throws ADKException
An agent can implement this method to count the number of messages
received, to signal the user interface or other interested parties that
a message has arrived, to examine or change the raw content of incoming
messages before they're dispatched to the framework, or to prevent the
framework from dispatching messages to message handlers. When filtering
messages, return true to allow the framework to process
this message, false to silently discard the message, or
throw an ADKException to return an error to the server.
onMessageReceived in interface MessagingListenermessageType - A message type constant (e.g. SIFMessagingListener.SIF_EVENT)message - A StringBuffer containing the message to be sent. The
contents of the buffer may be modified by this method.
RX_PROCESS to allow
the framework to process this message; RX_DISCARD to
silently discard the message; or RX_REPARSE if this
method has changed the content of the message parameter
StringBuffer.
ADKException - may be thrown by this method to return an error
acknowledgement to the server
void onMessageProcessed(byte messageType,
MessageInfo info)
throws ADKException
onMessageProcessed in interface MessagingListenermessageType - A message type constant (e.g. SIFMessagingListener.SIF_EVENT)info - The MessageInfo instance associated with the message
ADKException - may be thrown by this method to return an error
acknowledgement to the server
boolean onSendingMessage(byte messageType,
MessageInfo info,
java.lang.StringBuffer message)
An agent can implement this method to filter outbound messages in order
to change the message content or prevent the framework from sending a
message to the server. When filtering messages, return true
to allow the framework to send this message or false to
silently discard the message.
onSendingMessage in interface MessagingListenermessageType - A message type constant (e.g. SIFMessagingListener.SIF_EVENT)info - The MessageInfo instance associated with the messagemessage - A StringBuffer containing the message to be sent. The
contents of the buffer may be modified by this method.
void onMessageSent(byte messageType,
MessageInfo info,
java.lang.Object ack)
An agent can implement this method to count the number of messages sent or to signal the user interface or other interested parties that a message has been sent.
onMessageSent in interface MessagingListenermessageType - A message type constant (e.g. SIFMessagingListener.SIF_EVENT)info - The MessageInfo instance associated with the messageack - The SIF_Ack returned by the server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||