pawn.services.chat
Interface ChatService

All Superinterfaces:
net.jxta.platform.Module, net.jxta.service.Service
All Known Implementing Classes:
ChatServiceImpl

public interface ChatService
extends net.jxta.service.Service

An interface for the Chat service, a service that allows peers to request and approve chat sessions. This interface defines the operations a developer can expect to use to manipulate the Chat service regardless of which underlying implementation of the service is being used.


Field Summary
static java.lang.String refModuleClassID
          The module class ID for the Presence class of service.
 
Method Summary
 void addListener(pawn.services.chat.ChatListener listener)
          Add a listener object to the service.
 void approveChat(net.jxta.protocol.PipeAdvertisement pipeAdvertisement, java.lang.String emailAddress, java.lang.String displayName, int queryID)
          Approve a chat session.
 boolean removeListener(pawn.services.chat.ChatListener listener)
          Removes a given listener object from the service.
 void requestChat(java.lang.String peerID, java.lang.String emailAddress, java.lang.String displayName, pawn.services.chat.ChatListener listener)
          Send a request to chat to the peer specified.
 
Methods inherited from interface net.jxta.service.Service
getImplAdvertisement, getInterface
 
Methods inherited from interface net.jxta.platform.Module
init, startApp, stopApp
 

Field Detail

refModuleClassID

public static final java.lang.String refModuleClassID
The module class ID for the Presence class of service.

See Also:
Constant Field Values
Method Detail

addListener

public void addListener(pawn.services.chat.ChatListener listener)
Add a listener object to the service. When a new Initiate Chat Request or Response Message arrives, the service will notify each registered listener.

Parameters:
listener - the listener object to register with the service.

approveChat

public void approveChat(net.jxta.protocol.PipeAdvertisement pipeAdvertisement,
                        java.lang.String emailAddress,
                        java.lang.String displayName,
                        int queryID)
Approve a chat session.

Parameters:
pipeAdvertisement - the advertisement for the pipe that will be used to set up the chat session.
emailAddress - the emailAddress of the user associated with local peer.
displayName - the name of the user associated with the local peer.
queryID - the query ID to use to send to the Resolver Response Message containing the response, allowing the remote peer to match the response to an initial request.

removeListener

public boolean removeListener(pawn.services.chat.ChatListener listener)
Removes a given listener object from the service. Once removed, a listener will no longer be notified when a new Initiate Chat Request or Response Message arrives.

Parameters:
listener - the listener object to unregister.

requestChat

public void requestChat(java.lang.String peerID,
                        java.lang.String emailAddress,
                        java.lang.String displayName,
                        pawn.services.chat.ChatListener listener)
Send a request to chat to the peer specified.

Parameters:
peerID - the peerID of the remote peer to request for a chat session.
emailAddress - the email address of the user associated with the local peer.
displayName - the display name of the user associated with the local peer.
listener - the listener to notify when a response to this request is received.