public class PresenceManagerImpl extends BasicModule implements PresenceManager, UserEventListener, XMPPServerListener
SORT_ONLINE_TIME, SORT_USERNAME| Constructor and Description |
|---|
PresenceManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProbePresence(org.xmpp.packet.JID prober,
String probee)
Returns true if the the prober is allowed to see the presence of the probee.
|
long |
getLastActivity(User user)
Returns the number of milliseconds since the user went offline or -1 if such information
is not available or if the user is online.
|
String |
getLastPresenceStatus(User user)
Returns the status sent by the user in his last unavailable presence or null if the
user is online or never set such information.
|
org.xmpp.packet.Presence |
getPresence(User user)
Returns the user's current presence, or null if the user is unavailable.
|
Collection<org.xmpp.packet.Presence> |
getPresences(String username)
Returns all presences for the user, or null if the user is unavailable.
|
void |
handleProbe(org.xmpp.packet.Presence packet)
Handle a presence probe sent by a remote server.
|
void |
initialize(XMPPServer server)
Initializes the basic module.
|
boolean |
isAvailable(User user)
Returns the availability of the user.
|
void |
probePresence(org.xmpp.packet.JID prober,
org.xmpp.packet.JID probee)
Probes the presence of the given XMPPAddress and attempts to send it to the given user.
|
void |
sendUnavailableFromSessions(org.xmpp.packet.JID recipientJID,
org.xmpp.packet.JID userJID)
Sends unavailable presence from all of the user's available resources to the remote user.
|
void |
serverStarted()
Notification message indicating that the server has been started.
|
void |
serverStopping()
Notification message indication that the server is about to be stopped.
|
void |
start()
Starts the basic module.
|
void |
stop()
Stops the basic module.
|
void |
userAvailable(org.xmpp.packet.Presence presence)
Notification message saying that the sender of the given presence just became available.
|
void |
userCreated(User user,
Map<String,Object> params)
A user was created.
|
void |
userDeleting(User user,
Map<String,Object> params)
A user is being deleted.
|
void |
userModified(User user,
Map<String,Object> params)
A user's name, email, or an extended property was changed.
|
void |
userUnavailable(org.xmpp.packet.Presence presence)
Notification message saying that the sender of the given presence just became unavailable.
|
destroy, getNamepublic boolean isAvailable(User user)
PresenceManagerReturns the availability of the user.
isAvailable in interface PresenceManageruser - the user who's availability is in questionpublic org.xmpp.packet.Presence getPresence(User user)
PresenceManagergetPresence in interface PresenceManageruser - the user.public Collection<org.xmpp.packet.Presence> getPresences(String username)
PresenceManagergetPresences in interface PresenceManagerusername - the name of the user.public String getLastPresenceStatus(User user)
PresenceManagergetLastPresenceStatus in interface PresenceManageruser - the user to return his last status informationpublic long getLastActivity(User user)
PresenceManagergetLastActivity in interface PresenceManageruser - the user to return his information.public void userAvailable(org.xmpp.packet.Presence presence)
PresenceManageruserAvailable in interface PresenceManagerpresence - the presence sent by the available user.public void userUnavailable(org.xmpp.packet.Presence presence)
PresenceManageruserUnavailable in interface PresenceManagerpresence - the presence sent by the unavailable user.public void handleProbe(org.xmpp.packet.Presence packet)
throws UnauthorizedException
PresenceManagerhandleProbe in interface PresenceManagerpacket - the received probe presence from a remote server.UnauthorizedExceptionpublic boolean canProbePresence(org.xmpp.packet.JID prober,
String probee)
throws UserNotFoundException
PresenceManagercanProbePresence in interface PresenceManagerprober - the user that is trying to probe the presence of another user.probee - the username of the user that is being probed.UserNotFoundException - If the probee does not exist in the local server or the prober
is not present in the roster of the probee.public void probePresence(org.xmpp.packet.JID prober,
org.xmpp.packet.JID probee)
PresenceManagerprobePresence in interface PresenceManagerprober - The user requesting the probeprobee - The XMPPAddress whos presence we would like sent have have probedpublic void sendUnavailableFromSessions(org.xmpp.packet.JID recipientJID,
org.xmpp.packet.JID userJID)
PresenceManagersendUnavailableFromSessions in interface PresenceManagerrecipientJID - JID of the remote user that will receive the unavailable presences.userJID - JID of the local user.public void userCreated(User user, Map<String,Object> params)
UserEventListeneruserCreated in interface UserEventListeneruser - the user.params - event parameters.public void userDeleting(User user, Map<String,Object> params)
UserEventListeneruserDeleting in interface UserEventListeneruser - the user.params - event parameters.public void userModified(User user, Map<String,Object> params)
UserEventListeneruserModified in interface UserEventListeneruser - the user.params - event parameters.public void initialize(XMPPServer server)
BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize in interface Moduleinitialize in class BasicModuleserver - the server hosting this module.public void start()
throws IllegalStateException
BasicModuleStarts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start in interface Modulestart in class BasicModuleIllegalStateException - If start is called before initialize
successfully returnspublic void stop()
BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop in interface Modulestop in class BasicModulepublic void serverStarted()
XMPPServerListenerserverStarted in interface XMPPServerListenerpublic void serverStopping()
XMPPServerListenerserverStopping in interface XMPPServerListenerCopyright © 2003-2008 Jive Software.