02/28/2005
 

com.epicentric.users
Class UserGroupManager

java.lang.Object
  |
  +--com.epicentric.services.GenericService
        |
        +--com.epicentric.users.UserGroupManager
All Implemented Interfaces:
Service

Deprecated. as of Version 4.0, to be removed in 8.0 or later; instead, see the new UserGroupManager class

public abstract class UserGroupManager
extends GenericService

Interface to the underlying representation of user groups.


Inner Class Summary
static class UserGroupManager.GroupFormattedCreatedDateComparator
          Deprecated.  
static class UserGroupManager.GroupNameComparator
          Deprecated.  
 
Field Summary
static String ADD_GROUP_RELATIONSHIP
          Deprecated.  
protected  HashMap ancestorCache
          Deprecated. Maintains a map of UserGroup IDs to a Set of Ancestor UserGroup IDs.
static String DELETE_GROUP
          Deprecated.  
protected  HashMap descendantCache
          Deprecated. Maintains a map of UserGroup ids to a Set of descendant UserGroup ids.
protected  Hashtable groupCacheByID
          Deprecated.  
protected  Hashtable groupUIDToIDMapping
          Deprecated.  
static String REMOVE_GROUP_RELATIONSHIP
          Deprecated.  
 
Constructor Summary
protected UserGroupManager()
          Deprecated. Subclasses should call loadAllGroups()
 
Method Summary
 void announceGroupChange(int id)
          Deprecated. Announce the a group has changed.
 void announceGroupRelationshipChange(UserGroup parent, UserGroup child, String changeType)
          Deprecated. Announce that a group relationship has been changed.
protected static void copyGroups(Permission oldPerm, Permission newPerm)
          Deprecated. Copies group ids from one permission to another.
 UserGroup createGroup(String name, String description)
          Deprecated.  
protected abstract  UserGroup createGroup0(String name, String description)
          Deprecated. Subclasses should override to do actual group creation and storage
 void deleteGroup(UserGroup group)
          Deprecated.  
protected abstract  void deleteGroup0(UserGroup group)
          Deprecated. Subclasses should override to do actual group deletion
 void flushAncestorCache()
          Deprecated. Remove all ancestor cache entries.
 void flushAncestorCacheForGroup(UserGroup group)
          Deprecated. Remove the ancestor cache entry for a given group and any other entries that this group appears in.
protected  void flushCache(Map cache)
          Deprecated.  
protected  void flushCacheForGroup(Map cache, UserGroup group)
          Deprecated.  
 void flushDescendantCache()
          Deprecated. Remove all descendant cache entries.
 void flushDescendantCacheForGroup(UserGroup group)
          Deprecated. Remove the descendant cache entry for a given group and any other entries that this group appears in.
 Enumeration getAllGroups()
          Deprecated. Return a list of all groups, in alphabetical order
 Enumeration getAllGroups(Comparator sortInstructions)
          Deprecated. Return a list of all groups, sorted accoding to the provided comparator
 Set getAncestorGroupIDs(UserGroup group)
          Deprecated. Returns an unmodifiable Set containing all of the group ids (as Integer objects) that the input group inherits from.
protected  com.epicentric.broadcaster.Broadcaster getBroadcaster()
          Deprecated. Get broadcaster to be used to announce group changes.
static UserGroupManager getDefaultUserGroupManager()
          Deprecated. Return the default user manager as defined by the config file.
 Set getDescendantGroupIDs(UserGroup group)
          Deprecated. Returns an unmodifiable Set containing all of the group ids (as Integer objects) that inherit from the the input group.
 UserGroup getGroup(int id)
          Deprecated.  
abstract  UserGroup getGroup(String name)
          Deprecated. Group names are no longer unique. This method will return the first group found with the provided name
 UserGroup getGroupByUniqueID(String uniqueID)
          Deprecated. Get a group by unique id
 Enumeration getGroups(int offset, int numGroups)
          Deprecated. Returns a subset of groups based on a starting offset and a range.
 Enumeration getGroupsByOwnerID(int oid)
          Deprecated. Returns a collection of groups whose ownerID matches id or null if no such groups exist.
static UserGroupManager getInstance()
          Deprecated. As of version 3.5. Will be removed in 8.0 or later. Use getDefaultUserGroupManager() --- for now
 Enumeration getMatchingGroups(String query)
          Deprecated. Returns an Enumeration of all groups that have query as a substring in either their name or description fields, or null if there are no matching groups.
 Vector getMatchingGroupsAsVector(String query)
          Deprecated. Returns a Vector of all groups that have query as a substring in either their name or description fields, or null if there are no matching groups.
 int getNumGroups()
          Deprecated. Return number of groups in system, excluding the Everyone group.
static PermissionCatalog getStandardPermissionCatalog()
          Deprecated.  
protected  void installListener()
          Deprecated. Install a listener that updates and/or deletes cached group objects in response to broadcast events.
 boolean isValidAsParentGroup(UserGroup child, UserGroup proposedParent)
          Deprecated. Checks to see if the proposedParent group can be safely added as a parent of the given child group.
protected abstract  void loadAllGroups()
          Deprecated. Subclasses must implement to load group data into memory.
protected abstract  UserGroup reloadGroup(int id)
          Deprecated. return a group object freshly loaded from the database.
 void updateGroupRelationships(UserGroup parent, UserGroup child, String changeType)
          Deprecated. Updates the hierarchical relationship between two groups.
 void updateName(UserGroup group, String newName)
          Deprecated. Groups are no longer cached by name. This method is obsolete.
static void upgradeGroupPermissions(PermissionContext context)
          Deprecated. Upgrade a pre-3.0 userGroup's permissions.
 
Methods inherited from class com.epicentric.services.GenericService
getDescription, getID, getName, getServiceInfo, init, restart, setDescription, setID, setName, setServiceInfo, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_GROUP_RELATIONSHIP

public static final String ADD_GROUP_RELATIONSHIP
Deprecated. 

REMOVE_GROUP_RELATIONSHIP

public static final String REMOVE_GROUP_RELATIONSHIP
Deprecated. 

DELETE_GROUP

public static final String DELETE_GROUP
Deprecated. 

groupCacheByID

protected Hashtable groupCacheByID
Deprecated. 

groupUIDToIDMapping

protected Hashtable groupUIDToIDMapping
Deprecated. 

ancestorCache

protected HashMap ancestorCache
Deprecated. 
Maintains a map of UserGroup IDs to a Set of Ancestor UserGroup IDs.

descendantCache

protected HashMap descendantCache
Deprecated. 
Maintains a map of UserGroup ids to a Set of descendant UserGroup ids.
Constructor Detail

UserGroupManager

protected UserGroupManager()
Deprecated. 
Subclasses should call loadAllGroups()
Method Detail

getInstance

public static UserGroupManager getInstance()
Deprecated. As of version 3.5. Will be removed in 8.0 or later. Use getDefaultUserGroupManager() --- for now


getDefaultUserGroupManager

public static UserGroupManager getDefaultUserGroupManager()
Deprecated. 
Return the default user manager as defined by the config file.

loadAllGroups

protected abstract void loadAllGroups()
Deprecated. 
Subclasses must implement to load group data into memory.

getAllGroups

public Enumeration getAllGroups(Comparator sortInstructions)
Deprecated. 
Return a list of all groups, sorted accoding to the provided comparator

getAllGroups

public Enumeration getAllGroups()
Deprecated. 
Return a list of all groups, in alphabetical order

getGroupsByOwnerID

public Enumeration getGroupsByOwnerID(int oid)
Deprecated. 
Returns a collection of groups whose ownerID matches id or null if no such groups exist.

getGroups

public Enumeration getGroups(int offset,
                             int numGroups)
Deprecated. 
Returns a subset of groups based on a starting offset and a range. All groups starting with the group at index offset and ending (inclusive) with the group at index offset + numGroups - 1 (or all groups starting with the group at index offset and on through to the end of the collection if there are fewer than offset + numGroups groups) are returned inside an Enumeration. The index is 0 based and has no meaning beyond the context of this method (i.e., an index is not the same as a groupID). Here's a couple examples: getGroups( 0, 5 ) returns the first five (or fewer) groups from the collection. getGroups( 3, 3 ) returns the second three groups (0, 1, and 2 are skipped and 3, 4, and 5 are returned).

getNumGroups

public int getNumGroups()
Deprecated. 
Return number of groups in system, excluding the Everyone group.

getGroup

public UserGroup getGroup(int id)
Deprecated. 

getGroup

public abstract UserGroup getGroup(String name)
Deprecated. Group names are no longer unique. This method will return the first group found with the provided name


getGroupByUniqueID

public UserGroup getGroupByUniqueID(String uniqueID)
Deprecated. 
Get a group by unique id
Returns:
A UserGroup instance with the provided unique ID. If the UserGroup was not found, null will be returned

createGroup

public UserGroup createGroup(String name,
                             String description)
                      throws PersistificationException
Deprecated. 

createGroup0

protected abstract UserGroup createGroup0(String name,
                                          String description)
                                   throws PersistificationException
Deprecated. 
Subclasses should override to do actual group creation and storage

deleteGroup

public void deleteGroup(UserGroup group)
Deprecated. 

deleteGroup0

protected abstract void deleteGroup0(UserGroup group)
                              throws PersistificationException
Deprecated. 
Subclasses should override to do actual group deletion

reloadGroup

protected abstract UserGroup reloadGroup(int id)
                                  throws PersistificationException
Deprecated. 
return a group object freshly loaded from the database. Returns null if the group does not exist (or has been deleted).

updateName

public void updateName(UserGroup group,
                       String newName)
                throws PersistificationException
Deprecated. Groups are no longer cached by name. This method is obsolete.

Update our internal hash when a UserGroup has changed its name. Should be called by UserGroup on a name change. Throws exception if the group, old or new name is null, or if newName is the same as an existing name.

getBroadcaster

protected com.epicentric.broadcaster.Broadcaster getBroadcaster()
                                                         throws com.epicentric.broadcaster.BroadcasterException
Deprecated. 
Get broadcaster to be used to announce group changes.

announceGroupChange

public void announceGroupChange(int id)
Deprecated. 
Announce the a group has changed.

announceGroupRelationshipChange

public void announceGroupRelationshipChange(UserGroup parent,
                                            UserGroup child,
                                            String changeType)
Deprecated. 
Announce that a group relationship has been changed.

installListener

protected void installListener()
Deprecated. 
Install a listener that updates and/or deletes cached group objects in response to broadcast events.

getStandardPermissionCatalog

public static PermissionCatalog getStandardPermissionCatalog()
Deprecated. 

getMatchingGroups

public Enumeration getMatchingGroups(String query)
Deprecated. 
Returns an Enumeration of all groups that have query as a substring in either their name or description fields, or null if there are no matching groups. Note: this search is done in memory rather than in the group store and may possibly cause performance issues if there are a large number (thousands) of groups in the system.

getMatchingGroupsAsVector

public Vector getMatchingGroupsAsVector(String query)
Deprecated. 
Returns a Vector of all groups that have query as a substring in either their name or description fields, or null if there are no matching groups. This is a convenience method that calls getMatchingGroups() to do the dirty work
See Also:
UserGroupManager.getMatchingGroups(String query)

updateGroupRelationships

public void updateGroupRelationships(UserGroup parent,
                                     UserGroup child,
                                     String changeType)
Deprecated. 
Updates the hierarchical relationship between two groups. This method should only be called AFTER changes have been made at the physical storage level, or it will propagate stale data.

getAncestorGroupIDs

public Set getAncestorGroupIDs(UserGroup group)
Deprecated. 
Returns an unmodifiable Set containing all of the group ids (as Integer objects) that the input group inherits from.

getDescendantGroupIDs

public Set getDescendantGroupIDs(UserGroup group)
Deprecated. 
Returns an unmodifiable Set containing all of the group ids (as Integer objects) that inherit from the the input group.

isValidAsParentGroup

public boolean isValidAsParentGroup(UserGroup child,
                                    UserGroup proposedParent)
Deprecated. 
Checks to see if the proposedParent group can be safely added as a parent of the given child group. In this context, "safely" means that adding the group as a parent won't create any cyclical relationships among the child group's existing ancestor hierarchy and that the proposed parent group is not already a parent of the child group. Returns true if this proposedParent group may be safely added as a parent of the given child group, false otherwise.

flushAncestorCacheForGroup

public void flushAncestorCacheForGroup(UserGroup group)
Deprecated. 
Remove the ancestor cache entry for a given group and any other entries that this group appears in.

flushDescendantCacheForGroup

public void flushDescendantCacheForGroup(UserGroup group)
Deprecated. 
Remove the descendant cache entry for a given group and any other entries that this group appears in.

flushAncestorCache

public void flushAncestorCache()
Deprecated. 
Remove all ancestor cache entries.

flushDescendantCache

public void flushDescendantCache()
Deprecated. 
Remove all descendant cache entries.

flushCacheForGroup

protected void flushCacheForGroup(Map cache,
                                  UserGroup group)
Deprecated. 

upgradeGroupPermissions

public static void upgradeGroupPermissions(PermissionContext context)
Deprecated. 
Upgrade a pre-3.0 userGroup's permissions.

copyGroups

protected static void copyGroups(Permission oldPerm,
                                 Permission newPerm)
Deprecated. 
Copies group ids from one permission to another.

flushCache

protected void flushCache(Map cache)
Deprecated. 

02/28/2005
 

Copyright and Trademark Notices