Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.roster
Class RosterManager

java.lang.Object
  extended by org.jivesoftware.wildfire.container.BasicModule
      extended by org.jivesoftware.wildfire.roster.RosterManager
All Implemented Interfaces:
Module, GroupEventListener, UserEventListener

public class RosterManager
extends BasicModule
implements GroupEventListener, UserEventListener

A simple service that allows components to retrieve a roster based solely on the ID of the owner. Users have convenience methods for obtaining a roster associated with the owner. However there are many components that need to retrieve the roster based solely on the generic ID owner key. This interface defines a service that can do that. This allows classes that generically manage resource for resource owners (such as presence updates) to generically offer their services without knowing or caring if the roster owner is a user, chatbot, etc.

Author:
Iain Shigeoka

Constructor Summary
RosterManager()
           
 
Method Summary
 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(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.
 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.
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 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 params)
          A new user has been created so members of public shared groups need to have their rosters updated.
 void userDeleting(User user, Map params)
          A user is being deleted.
 void userModified(User user, Map params)
          A user's name, email, or an extended property was changed.
 
Methods inherited from class org.jivesoftware.wildfire.container.BasicModule
destroy, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RosterManager

public RosterManager()
Method Detail

isRosterServiceEnabled

public static boolean isRosterServiceEnabled()
Returns true if the roster service is enabled. When disabled it is not possible to retrieve users rosters or broadcast presence packets to roster contacts.

Returns:
true if the roster service is enabled.

getRoster

public Roster getRoster(String username)
                 throws UserNotFoundException
Returns the roster for the given username.

Parameters:
username - the username to search for.
Returns:
the roster associated with the ID.
Throws:
UserNotFoundException - if the ID does not correspond to a known entity on the server.

deleteRoster

public void deleteRoster(JID user)
Removes the entire roster of a given user. This is necessary when a user account is being deleted from the server.

Parameters:
user - the user.

getSharedGroups

public Collection<Group> getSharedGroups(String username)
Returns a collection with all the groups that the user may include in his roster. The following criteria will be used to select the groups: 1) Groups that are configured so that everybody can include in his roster, 2) Groups that are configured so that its users may include the group in their rosters and the user is a group user of the group and 3) User belongs to a Group that may see a Group that whose members may include the Group in their rosters.

Parameters:
username - the username of the user to return his shared groups.
Returns:
a collection with all the groups that the user may include in his roster.

getPublicSharedGroups

public Collection<Group> getPublicSharedGroups()
Returns the list of shared groups whose visibility is public.

Returns:
the list of shared groups whose visibility is public.

groupCreated

public void groupCreated(Group group,
                         Map params)
Description copied from interface: GroupEventListener
A group was created.

Specified by:
groupCreated in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

groupDeleting

public void groupDeleting(Group group,
                          Map params)
Description copied from interface: GroupEventListener
A group is being deleted.

Specified by:
groupDeleting in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

groupModified

public void groupModified(Group group,
                          Map params)
Description copied from interface: GroupEventListener
A group's name, description, or an extended property was changed.

Specified by:
groupModified in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

initialize

public void initialize(XMPPServer server)
Description copied from class: BasicModule

Initializes the basic module.

Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

Specified by:
initialize in interface Module
Overrides:
initialize in class BasicModule
Parameters:
server - the server hosting this module.

isSharedGroup

public static boolean isSharedGroup(Group group)
Returns true if the specified Group may be included in a user roster. The decision is made based on the group properties that are configurable through the Admin Console.

Parameters:
group - the group to check if it may be considered a shared group.
Returns:
true if the specified Group may be included in a user roster.

isPublicSharedGroup

public static boolean isPublicSharedGroup(Group group)
Returns true if the specified Group may be seen by all users in the system. The decision is made based on the group properties that are configurable through the Admin Console.

Parameters:
group - the group to check if it may be seen by all users in the system.
Returns:
true if the specified Group may be seen by all users in the system.

memberAdded

public void memberAdded(Group group,
                        Map params)
Description copied from interface: GroupEventListener
A member was added to a group.

Specified by:
memberAdded in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

memberRemoved

public void memberRemoved(Group group,
                          Map params)
Description copied from interface: GroupEventListener
A member was removed from a group.

Specified by:
memberRemoved in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

adminAdded

public void adminAdded(Group group,
                       Map params)
Description copied from interface: GroupEventListener
An administrator was added to a group.

Specified by:
adminAdded in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

adminRemoved

public void adminRemoved(Group group,
                         Map params)
Description copied from interface: GroupEventListener
An administrator was removed from a group.

Specified by:
adminRemoved in interface GroupEventListener
Parameters:
group - the group.
params - event parameters.

userCreated

public void userCreated(User newUser,
                        Map params)
A new user has been created so members of public shared groups need to have their rosters updated. Members of public shared groups need to have a roster item with subscription FROM for the new user since the new user can see them.

Specified by:
userCreated in interface UserEventListener
Parameters:
newUser - the newly created user.
params - event parameters.

userDeleting

public void userDeleting(User user,
                         Map params)
Description copied from interface: UserEventListener
A user is being deleted.

Specified by:
userDeleting in interface UserEventListener
Parameters:
user - the user.
params - event parameters.

userModified

public void userModified(User user,
                         Map params)
Description copied from interface: UserEventListener
A user's name, email, or an extended property was changed.

Specified by:
userModified in interface UserEventListener
Parameters:
user - the user.
params - event parameters.

start

public void start()
           throws IllegalStateException
Description copied from class: BasicModule

Starts the basic module.

Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

Specified by:
start in interface Module
Overrides:
start in class BasicModule
Throws:
IllegalStateException - If start is called before initialize successfully returns

stop

public void stop()
Description copied from class: BasicModule

Stops the basic module.

Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

Specified by:
stop in interface Module
Overrides:
stop in class BasicModule

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.