|
Openfire 3.5.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.container.BasicModule org.jivesoftware.openfire.spi.PresenceManagerImpl
public class PresenceManagerImpl
Simple in memory implementation of the PresenceManager interface.
Field Summary |
---|
Fields inherited from interface org.jivesoftware.openfire.PresenceManager |
---|
SORT_ONLINE_TIME, SORT_USERNAME |
Constructor Summary | |
---|---|
PresenceManagerImpl()
|
Method Summary | |
---|---|
boolean |
canProbePresence(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. |
Presence |
getPresence(User user)
Returns the user's current presence, or null if the user is unavailable. |
Collection<Presence> |
getPresences(String username)
Returns all presences for the user, or null if the user is unavailable. |
void |
handleProbe(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(JID prober,
JID probee)
Probes the presence of the given XMPPAddress and attempts to send it to the given user. |
void |
sendUnavailableFromSessions(JID recipientJID,
JID userJID)
Sends unavailable presence from all of the user's available resources to the remote user. |
void |
start()
Starts the basic module. |
void |
stop()
Stops the basic module. |
void |
userAvailable(Presence presence)
Notification message saying that the sender of the given presence just became available. |
void |
userUnavailable(Presence presence)
Notification message saying that the sender of the given presence just became unavailable. |
Methods inherited from class org.jivesoftware.openfire.container.BasicModule |
---|
destroy, getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PresenceManagerImpl()
Method Detail |
---|
public boolean isAvailable(User user)
PresenceManager
Returns the availability of the user.
isAvailable
in interface PresenceManager
user
- the user who's availability is in question
public Presence getPresence(User user)
PresenceManager
getPresence
in interface PresenceManager
user
- the user.
public Collection<Presence> getPresences(String username)
PresenceManager
getPresences
in interface PresenceManager
username
- the name of the user.
public String getLastPresenceStatus(User user)
PresenceManager
getLastPresenceStatus
in interface PresenceManager
user
- the user to return his last status information
public long getLastActivity(User user)
PresenceManager
getLastActivity
in interface PresenceManager
user
- the user to return his information.
public void userAvailable(Presence presence)
PresenceManager
userAvailable
in interface PresenceManager
presence
- the presence sent by the available user.public void userUnavailable(Presence presence)
PresenceManager
userUnavailable
in interface PresenceManager
presence
- the presence sent by the unavailable user.public void handleProbe(Presence packet) throws UnauthorizedException
PresenceManager
handleProbe
in interface PresenceManager
packet
- the received probe presence from a remote server.
UnauthorizedException
public boolean canProbePresence(JID prober, String probee) throws UserNotFoundException
PresenceManager
canProbePresence
in interface PresenceManager
prober
- the user that is trying to probe the presence of another user.probee
- the username of the uset 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(JID prober, JID probee)
PresenceManager
probePresence
in interface PresenceManager
prober
- The user requesting the probeprobee
- The XMPPAddress whos presence we would like sent have have probedpublic void sendUnavailableFromSessions(JID recipientJID, JID userJID)
PresenceManager
sendUnavailableFromSessions
in interface PresenceManager
recipientJID
- JID of the remote user that will receive the unavailable presences.userJID
- JID of the local user.public void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class BasicModule
server
- the server hosting this module.public void start() throws IllegalStateException
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
IllegalStateException
- If start is called before initialize
successfully returnspublic void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
|
Openfire 3.5.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |