pawn.services.presence
Interface PresenceService

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

public interface PresenceService
extends net.jxta.service.Service

An interface for the Presence service, a service that allows peers to exchange presence status information specifying their current status (offline, online, busy, away). This interface defines the operations a developer can expect to use to manipulate the Presence service regardless of which underlying implementation of the service is being used.


Field Summary
static int AWAY
          A status value indicating a user is currently online, but is temporarily away from their device.
static int BUSY
          A status value indicating a user is currently online, but is busy and does not wish to be disturbed.
static int OFFLINE
          A status value indicating a user is currently offline.
static int ONLINE
          A status value indicating a user is currently online.
static java.lang.String refModuleClassID
          The module class ID for the Presence class of service.
 
Method Summary
 void addListener(pawn.services.presence.PresenceListener listener)
          Add a listener object to the service.
 void announcePresence(int presenceStatus, java.lang.String emailAddress, java.lang.String name)
          Announce updated presence information within the peer group.
 void findPresence(java.lang.String emailAddress)
          Sends a query to find presence information for the user specified by the given email address.
 boolean removeListener(pawn.services.presence.PresenceListener listener)
          Removes a given listener object from the service.
 
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

AWAY

public static final int AWAY
A status value indicating a user is currently online, but is temporarily away from their device.

See Also:
Constant Field Values

BUSY

public static final int BUSY
A status value indicating a user is currently online, but is busy and does not wish to be disturbed.

See Also:
Constant Field Values

OFFLINE

public static final int OFFLINE
A status value indicating a user is currently offline.

See Also:
Constant Field Values

ONLINE

public static final int ONLINE
A status value indicating a user is currently online.

See Also:
Constant Field Values
Method Detail

addListener

public void addListener(pawn.services.presence.PresenceListener listener)
Add a listener object to the service. When a new Presence Response Message arrives, the service will notify each registered listener.

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

announcePresence

public void announcePresence(int presenceStatus,
                             java.lang.String emailAddress,
                             java.lang.String name)
Announce updated presence information within the peer group.

Parameters:
presenceStatus - the updated status for the user identified by the email address.
emailAddress - the email address used to identify the user associated with the presence info.
name - a display name for the user associated with the presence info.

findPresence

public void findPresence(java.lang.String emailAddress)
Sends a query to find presence information for the user specified by the given email address. Any response received by the service will be dispatched to registered PresenceListener objects.

Parameters:
emailAddress - the email address to use to find presence info.

removeListener

public boolean removeListener(pawn.services.presence.PresenceListener listener)
Removes a given listener object from the service. Once removed, a listener will no longer be notified when a new Presence Response Message arrives.

Parameters:
listener - the listener object to unregister.