com.caucho.xmpp
Class XmppAgentStream

java.lang.Object
  extended by com.caucho.bam.stream.AbstractMessageStream
      extended by com.caucho.xmpp.XmppAgentStream
All Implemented Interfaces:
MessageStream

public class XmppAgentStream
extends AbstractMessageStream

Handles callbacks for a xmpp service


Method Summary
 void close()
          closes the stream.
 java.lang.String getAddress()
          Returns the address of the client
 boolean isClosed()
          Tests if the stream is closed.
 void message(java.lang.String to, java.lang.String from, java.io.Serializable value)
          Receives a unidirectional message.
 void messageError(java.lang.String to, java.lang.String from, java.io.Serializable value, BamError error)
          Receives a message error.
 void presence(java.lang.String to, java.lang.String from, java.io.Serializable data)
          General presence, for clients announcing availability
 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 probe from the 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)
          General presence, for clients announcing unavailability
 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 query(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
          Receives a query call, acting as a service for the query.
 void queryError(long id, java.lang.String to, java.lang.String from, java.io.Serializable query, BamError error)
          Handles a query error from a service Actor.
 void queryResult(long bamId, java.lang.String to, java.lang.String from, java.io.Serializable value)
          Handles a query response from a service Actor.
 void querySet(long id, java.lang.String to, java.lang.String from, java.io.Serializable query)
           
 
Methods inherited from class com.caucho.bam.stream.AbstractMessageStream
getBroker, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAddress

public java.lang.String getAddress()
Returns the address of the client

Specified by:
getAddress in interface MessageStream
Overrides:
getAddress in class AbstractMessageStream

message

public void message(java.lang.String to,
                    java.lang.String from,
                    java.io.Serializable value)
Description copied from class: AbstractMessageStream
Receives a unidirectional message. The abstract implementation ignores the message.

Specified by:
message in interface MessageStream
Overrides:
message in class AbstractMessageStream
Parameters:
to - the target actor's address
from - the source actor's address
value - the message payload

messageError

public void messageError(java.lang.String to,
                         java.lang.String from,
                         java.io.Serializable value,
                         BamError error)
Description copied from class: AbstractMessageStream
Receives a message error. The abstract implementation ignores the message.

Specified by:
messageError in interface MessageStream
Overrides:
messageError in class AbstractMessageStream
Parameters:
to - the target actor's address
from - the source actor's address
value - the original message payload
error - the message error

query

public void query(long id,
                  java.lang.String to,
                  java.lang.String from,
                  java.io.Serializable query)
Description copied from class: AbstractMessageStream
Receives a query call, acting as a service for the query. The default implementation returns a feature-not-implemented QueryError message to the client.

Specified by:
query in interface MessageStream
Overrides:
query in class AbstractMessageStream
Parameters:
id - the query identifier used to match requests with responses
to - the service actor's address
from - the client actor's address
query - the query payload

querySet

public void querySet(long id,
                     java.lang.String to,
                     java.lang.String from,
                     java.io.Serializable query)

queryResult

public void queryResult(long bamId,
                        java.lang.String to,
                        java.lang.String from,
                        java.io.Serializable value)
Description copied from class: AbstractMessageStream
Handles a query response from a service Actor. The default implementation ignores the packet.

Specified by:
queryResult in interface MessageStream
Overrides:
queryResult in class AbstractMessageStream
Parameters:
bamId - the query identifier used to match requests with responses
to - the client actor's address
from - the service actor's address
value - the result payload

queryError

public void queryError(long id,
                       java.lang.String to,
                       java.lang.String from,
                       java.io.Serializable query,
                       BamError error)
Description copied from class: AbstractMessageStream
Handles a query error from a service Actor. The default implementation ignores the packet.

Specified by:
queryError in interface MessageStream
Overrides:
queryError in class AbstractMessageStream
Parameters:
id - the query identifier used to match requests with responses
to - the client actor's address
from - the service actor's address
query - the result payload
error - additional error information

presence

public void presence(java.lang.String to,
                     java.lang.String from,
                     java.io.Serializable data)
General presence, for clients announcing availability


presenceUnavailable

public void presenceUnavailable(java.lang.String to,
                                java.lang.String from,
                                java.io.Serializable data)
General presence, for clients announcing unavailability


presenceProbe

public void presenceProbe(java.lang.String to,
                          java.lang.String from,
                          java.io.Serializable data)
Presence probe from the server to a client


presenceSubscribe

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


presenceSubscribed

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


presenceUnsubscribe

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


presenceUnsubscribed

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


presenceError

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


isClosed

public boolean isClosed()
Description copied from class: AbstractMessageStream
Tests if the stream is closed.

Specified by:
isClosed in interface MessageStream
Overrides:
isClosed in class AbstractMessageStream

close

public void close()
closes the stream.