public class RosterManager extends BasicModule implements GroupEventListener, UserEventListener
| Constructor and Description |
|---|
RosterManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
adminAdded(Group group,
Map params)
An administrator was added to a group.
|
void |
adminRemoved(Group group,
Map params)
An administrator was removed from a group.
|
void |
deleteRoster(org.xmpp.packet.JID user)
Removes the entire roster of a given user.
|
Collection<Group> |
getPublicSharedGroups()
Returns the list of shared groups whose visibility is public.
|
Roster |
getRoster(String username)
Returns the roster for the given username.
|
static RosterItemProvider |
getRosterItemProvider() |
Collection<Group> |
getSharedGroups(String username)
Returns a collection with all the groups that the user may include in his roster.
|
void |
groupCreated(Group group,
Map params)
A group was created.
|
void |
groupDeleting(Group group,
Map params)
A group is being deleted.
|
void |
groupModified(Group group,
Map params)
A group's name, description, or an extended property was changed.
|
void |
initialize(XMPPServer server)
Initializes the basic module.
|
boolean |
isGroupVisible(Group group,
org.xmpp.packet.JID user)
Returns true if a given group is visible to a given user.
|
static boolean |
isPublicSharedGroup(Group group)
Returns true if the specified Group may be seen by all users in the system.
|
static boolean |
isRosterServiceEnabled()
Returns true if the roster service is enabled.
|
static boolean |
isRosterVersioningEnabled()
Returns true if the roster versioning is enabled.
|
static boolean |
isSharedGroup(Group group)
Returns true if the specified Group may be included in a user roster.
|
void |
memberAdded(Group group,
Map params)
A member was added to a group.
|
void |
memberRemoved(Group group,
Map params)
A member was removed from a group.
|
void |
start()
Starts the basic module.
|
void |
stop()
Stops the basic module.
|
void |
userCreated(User newUser,
Map<String,Object> params)
A new user has been created so members of public shared groups need to have
their rosters updated.
|
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.
|
destroy, getNamepublic static boolean isRosterServiceEnabled()
public static boolean isRosterVersioningEnabled()
public Roster getRoster(String username) throws UserNotFoundException
username - the username to search for.UserNotFoundException - if the ID does not correspond
to a known entity on the server.public void deleteRoster(org.xmpp.packet.JID user)
user - the user.public Collection<Group> getSharedGroups(String username)
username - the username of the user to return his shared groups.public Collection<Group> getPublicSharedGroups()
public void groupCreated(Group group, Map params)
GroupEventListenergroupCreated in interface GroupEventListenergroup - the group.params - event parameters.public void groupDeleting(Group group, Map params)
GroupEventListenergroupDeleting in interface GroupEventListenergroup - the group.params - event parameters.public void groupModified(Group group, Map params)
GroupEventListenergroupModified in interface GroupEventListenergroup - the group.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 static boolean isSharedGroup(Group group)
group - the group to check if it may be considered a shared group.public static boolean isPublicSharedGroup(Group group)
group - the group to check if it may be seen by all users in the system.public void memberAdded(Group group, Map params)
GroupEventListenermemberAdded in interface GroupEventListenergroup - the group.params - event parameters.public void memberRemoved(Group group, Map params)
GroupEventListenermemberRemoved in interface GroupEventListenergroup - the group.params - event parameters.public void adminAdded(Group group, Map params)
GroupEventListeneradminAdded in interface GroupEventListenergroup - the group.params - event parameters.public void adminRemoved(Group group, Map params)
GroupEventListeneradminRemoved in interface GroupEventListenergroup - the group.params - event parameters.public void userCreated(User newUser, Map<String,Object> params)
userCreated in interface UserEventListenernewUser - the newly created 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 boolean isGroupVisible(Group group, org.xmpp.packet.JID user)
group - the group to check if the user can see.user - the JID of the user to check if he may see the group.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 static RosterItemProvider getRosterItemProvider()
Copyright © 2003-2008 Jive Software.