|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.database.DbPresenceManager
public class DbPresenceManager
Database implementation of the PresenceManager interface.
Field Summary | |
---|---|
Cache |
onlineGuestCache
|
Cache |
onlineUserCache
|
Cache |
userRosterCache
|
Fields inherited from interface com.jivesoftware.base.PresenceManager |
---|
SORT_ONLINE_TIME, SORT_USERNAME |
Method Summary | |
---|---|
Presence |
createPresence(User user,
java.lang.String uid,
java.lang.String IPAddress)
Create a presence for a user. |
void |
destroy()
Notifies the manager to release any resources that may be holding on too. |
static DbPresenceManager |
getInstance()
|
int |
getOnlineGuestCount()
Returns the number of guests who are currently online. |
int |
getOnlineUserCount()
Returns the number of users who are currently online. |
int |
getOnlineUserCount(Group group)
Returns the number of users in the group who are currently online. |
java.util.Iterator |
getOnlineUsers()
Returns an iterator of users who are currently online. |
java.util.Iterator |
getOnlineUsers(boolean ascending,
int sortField)
Returns an iterator of users sorted in the manner requested who are currently online. |
java.util.Iterator |
getOnlineUsers(boolean ascending,
int sortField,
int numResults)
Returns an iterator of users who are currently online matching the criteria given. |
java.util.Iterator |
getOnlineUsers(boolean ascending,
int sortField,
int start,
int numResults)
Returns an iterator of users who are currently online matching the criteria given. |
java.util.Iterator |
getOnlineUsers(Group group)
Returns an iterator of users in the group who are currently online. |
java.util.Iterator |
getOnlineUsers(Group group,
boolean ascending,
int sortField)
Returns an iterator of users sorted in the manner requested who are currently online. |
java.util.Iterator |
getOnlineUsers(Group group,
boolean ascending,
int sortField,
int numResults)
Returns an iterator of users who are currently online matching the criteria given. |
Presence |
getPresence(java.lang.String presenceID)
|
Presence |
getPresence(User user)
Returns the presence for the user, or null if the user isn't online. |
Roster |
getRoster(User user)
Returns the user's roster. |
void |
initialize()
Initialize the manager. |
boolean |
isOnline(User user)
Returns whether the user is currently online or not. |
boolean |
isPresencesEnabled()
Returns whether presences are enabled on a global basis or not. |
void |
setOffline(Presence presence)
Sets a presence to be offline which causes the presence to be removed from the system. |
void |
setOnline(Presence presence)
|
void |
setPresencesEnabled(boolean enabled)
Sets whether presences are enabled on a global basis or not. |
void |
userCreated(UserEvent event)
Fired when a user is created. |
void |
userDeleted(UserEvent event)
Fired when a user is deleted. |
void |
userModified(UserEvent event)
Fired when a user is modified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Cache onlineGuestCache
public Cache onlineUserCache
public Cache userRosterCache
Method Detail |
---|
public static DbPresenceManager getInstance()
public void initialize()
JiveManager
This method is used internally by Jive during application startup and should not be called during normal usage of the class.
initialize
in interface JiveManager
public void destroy()
JiveManager
destroy
in interface JiveManager
public boolean isPresencesEnabled()
PresenceManager
isPresencesEnabled
in interface PresenceManager
public void setPresencesEnabled(boolean enabled) throws UnauthorizedException
PresenceManager
setPresencesEnabled
in interface PresenceManager
enabled
- true if presences should be enabled, false otherwise.
UnauthorizedException
- if not a system administrator.public int getOnlineUserCount()
PresenceManager
getOnlineUserCount
in interface PresenceManager
public int getOnlineUserCount(Group group)
PresenceManager
getOnlineUserCount
in interface PresenceManager
group
- the group to return the online user count.
public int getOnlineGuestCount()
PresenceManager
getOnlineGuestCount
in interface PresenceManager
public java.util.Iterator getOnlineUsers()
PresenceManager
getOnlineUsers
in interface PresenceManager
public java.util.Iterator getOnlineUsers(Group group)
PresenceManager
getOnlineUsers
in interface PresenceManager
group
- the group to return the online users.
public java.util.Iterator getOnlineUsers(boolean ascending, int sortField)
PresenceManager
getOnlineUsers
in interface PresenceManager
ascending
- sort ascending if true, descending if false.sortField
- a valid sort field from the PresenceManager interface.
public java.util.Iterator getOnlineUsers(Group group, boolean ascending, int sortField)
PresenceManager
getOnlineUsers
in interface PresenceManager
group
- the group to return the online users.ascending
- sort ascending if true, descending if false.sortField
- a valid sort field from the PresenceManager interface.
public java.util.Iterator getOnlineUsers(boolean ascending, int sortField, int numResults)
PresenceManager
getOnlineUsers
in interface PresenceManager
ascending
- sort ascending if true, descending if false.sortField
- a valid sort field from the PresenceManager interface.numResults
- - the number of results to return.
public java.util.Iterator getOnlineUsers(boolean ascending, int sortField, int start, int numResults)
PresenceManager
getOnlineUsers
in interface PresenceManager
ascending
- sort ascending if true, descending if false.sortField
- a valid sort field from the PresenceManager interface.start
- the index into the sorted set of users to start iterating from.numResults
- - the number of results to return.
public java.util.Iterator getOnlineUsers(Group group, boolean ascending, int sortField, int numResults)
PresenceManager
getOnlineUsers
in interface PresenceManager
ascending
- sort ascending if true, descending if false.sortField
- a valid sort field from the PresenceManager interface.numResults
- - the number of results to return.
public Presence createPresence(User user, java.lang.String uid, java.lang.String IPAddress)
PresenceManager
The uid should be unique within the application instance. A good source of a uid is the servlet session id.
createPresence
in interface PresenceManager
user
- the user to create a presence for.uid
- a unique string.IPAddress
- the IP address of the user.
public void setOnline(Presence presence)
public void setOffline(Presence presence)
PresenceManager
setOffline
in interface PresenceManager
presence
- to presence to set to be offline.public boolean isOnline(User user)
PresenceManager
isOnline
in interface PresenceManager
user
- the user to check to see if they're online.public Presence getPresence(User user)
PresenceManager
getPresence
in interface PresenceManager
user
- the user to return the presence for.
public Presence getPresence(java.lang.String presenceID)
public Roster getRoster(User user)
PresenceManager
getRoster
in interface PresenceManager
user
- the user to return the roster for.
public void userCreated(UserEvent event)
UserListener
userCreated
in interface UserListener
event
- the UserEventpublic void userDeleted(UserEvent event)
UserListener
userDeleted
in interface UserListener
event
- the UserEventpublic void userModified(UserEvent event)
UserListener
userModified
in interface UserListener
event
- the UserEvent
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |