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, getName
public 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)
GroupEventListener
groupCreated
in interface GroupEventListener
group
- the group.params
- event parameters.public void groupDeleting(Group group, Map params)
GroupEventListener
groupDeleting
in interface GroupEventListener
group
- the group.params
- event parameters.public void groupModified(Group group, Map params)
GroupEventListener
groupModified
in interface GroupEventListener
group
- the group.params
- event parameters.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 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)
GroupEventListener
memberAdded
in interface GroupEventListener
group
- the group.params
- event parameters.public void memberRemoved(Group group, Map params)
GroupEventListener
memberRemoved
in interface GroupEventListener
group
- the group.params
- event parameters.public void adminAdded(Group group, Map params)
GroupEventListener
adminAdded
in interface GroupEventListener
group
- the group.params
- event parameters.public void adminRemoved(Group group, Map params)
GroupEventListener
adminRemoved
in interface GroupEventListener
group
- the group.params
- event parameters.public void userCreated(User newUser, Map<String,Object> params)
userCreated
in interface UserEventListener
newUser
- the newly created user.params
- event parameters.public void userDeleting(User user, Map<String,Object> params)
UserEventListener
userDeleting
in interface UserEventListener
user
- the user.params
- event parameters.public void userModified(User user, Map<String,Object> params)
UserEventListener
userModified
in interface UserEventListener
user
- 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
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
public static RosterItemProvider getRosterItemProvider()
Copyright © 2003–2020 Ignite Realtime. All rights reserved.