com.caucho.bam
Interface BamStream

All Known Implementing Classes:
AbstractBamFilter, AbstractBamStream, AuthBrokerStream, BamJmsService, BamLogService, BamMailService, BamPhpAgent, BamPhpRootService, ClientBrokerStream, DeployService, GenericService, HempBroker, HempDomainService, HempMemoryQueue, HmuxReceiver, ImAgentFilter, ImBrokerFilter, ImBrokerFilter, ImUser, ImUserService, JMXService, MemoryNick, MemoryPubSub, MemoryRoom, ProServer, ServerAgentStream, ServerBrokerStream, SimpleBamService, XmppAgentStream, XmppBindCallback, XmppBrokerStream

public interface BamStream

Main agent callback to handle packet events. Each method corresponds to a packet class.


Method Summary
 java.lang.String getJid()
          Returns the jid of the agent at the end of the stream.
 void message(java.lang.String to, java.lang.String from, java.io.Serializable value)
          Sends a message to an agent
 void messageError(java.lang.String to, java.lang.String from, java.io.Serializable value, BamError error)
          Sends a message error to an agent
 void presence(java.lang.String to, java.lang.String from, java.io.Serializable data)
          Announces an agent's presence, e.g.
 void presenceError(java.lang.String to, java.lang.String from, java.io.Serializable data, BamError error)
          An error response to a client
 void presenceProbe(java.lang.String to, java.lang.String from, java.io.Serializable data)
          Presence forwarding announcement from a server to a client.
 void presenceSubscribe(java.lang.String to, java.lang.String from, java.io.Serializable data)
          A subscription request from a client
 void presenceSubscribed(java.lang.String to, java.lang.String from, java.io.Serializable data)
          A subscription response to a client
 void presenceUnavailable(java.lang.String to, java.lang.String from, java.io.Serializable data)
          Announces a logout of an agent.
 void presenceUnsubscribe(java.lang.String to, java.lang.String from, java.io.Serializable data)
          An unsubscription request from a client
 void presenceUnsubscribed(java.lang.String to, java.lang.String from, java.io.Serializable data)
          A unsubscription response to a client
 void queryError(long id, java.lang.String to, java.lang.String from, java.io.Serializable query, BamError error)
          Handles the query error from a corresponding queryGet or querySet.
 boolean queryGet(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
          Sends a query information call (get), returning true if this handler understands the query class, and false if it does not.
 void queryResult(long id, java.lang.String to, java.lang.String from, java.io.Serializable value)
          Handles the query response from a corresponding queryGet or querySet.
 boolean querySet(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
          Sends a query update request (set), returning true if this handler understands the query class, and false if it does not.
 

Method Detail

getJid

java.lang.String getJid()
Returns the jid of the agent at the end of the stream. For brokers, returns null.


message

void message(java.lang.String to,
             java.lang.String from,
             java.io.Serializable value)
Sends a message to an agent

Parameters:
to - the target agent's JID
from - the source agent's JID
value - the message payload

messageError

void messageError(java.lang.String to,
                  java.lang.String from,
                  java.io.Serializable value,
                  BamError error)
Sends a message error to an agent

Parameters:
to - the target agent's JID
from - the source agent's JID
value - the message payload
error - the message error

queryGet

boolean queryGet(long id,
                 java.lang.String to,
                 java.lang.String from,
                 java.io.Serializable query)
Sends a query information call (get), returning true if this handler understands the query class, and false if it does not. If queryGet returns true, the handler MUST send a queryResult or queryError to the sender, using the same id.

Parameters:
id - the query identifier used to match requests with responses
to - the target JID
from - the source JID, used as the target for the response
query - the query payload
Returns:
true if this handler understand the query, false otherwise

querySet

boolean querySet(long id,
                 java.lang.String to,
                 java.lang.String from,
                 java.io.Serializable query)
Sends a query update request (set), returning true if this handler understands the query class, and false if it does not. If querySet returns true, the handler MUST send a queryResult or queryError to the sender, using the same id.

Parameters:
id - the query identifier used to match requests with responses
to - the target JID
from - the source JID, used as the target for the response
query - the query payload
Returns:
true if this handler understand the query, false otherwise

queryResult

void queryResult(long id,
                 java.lang.String to,
                 java.lang.String from,
                 java.io.Serializable value)
Handles the query response from a corresponding queryGet or querySet.

Parameters:
id - the query identifier used to match requests with responses
to - the target JID
from - the source JID, used as the target for the response
value - the result payload

queryError

void queryError(long id,
                java.lang.String to,
                java.lang.String from,
                java.io.Serializable query,
                BamError error)
Handles the query error from a corresponding queryGet or querySet.

Parameters:
id - the query identifier used to match requests with responses
to - the target JID
from - the source JID, used as the target for the response
query - the query payload
error - additional error information

presence

void presence(java.lang.String to,
              java.lang.String from,
              java.io.Serializable data)
Announces an agent's presence, e.g. for an IM user logging on or changing their status text.


presenceUnavailable

void presenceUnavailable(java.lang.String to,
                         java.lang.String from,
                         java.io.Serializable data)
Announces a logout of an agent.


presenceProbe

void presenceProbe(java.lang.String to,
                   java.lang.String from,
                   java.io.Serializable data)
Presence forwarding announcement from a server to a client.


presenceSubscribe

void presenceSubscribe(java.lang.String to,
                       java.lang.String from,
                       java.io.Serializable data)
A subscription request from a client


presenceSubscribed

void presenceSubscribed(java.lang.String to,
                        java.lang.String from,
                        java.io.Serializable data)
A subscription response to a client


presenceUnsubscribe

void presenceUnsubscribe(java.lang.String to,
                         java.lang.String from,
                         java.io.Serializable data)
An unsubscription request from a client


presenceUnsubscribed

void presenceUnsubscribed(java.lang.String to,
                          java.lang.String from,
                          java.io.Serializable data)
A unsubscription response to a client


presenceError

void presenceError(java.lang.String to,
                   java.lang.String from,
                   java.io.Serializable data,
                   BamError error)
An error response to a client