Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.groups
Class ReferenceGroupService

    java.lang.Object
      org.jasig.portal.groups.ReferenceGroupService

All Implemented Interfaces:
  IGroupService, ILockableGroupService

    public class ReferenceGroupService

extends java.lang.Object
implements ILockableGroupService

Reference group service.

Version:
  $Revision: 1.25 $
Author:
  Dan Ellentuck

Field Summary
`private boolean` | `cacheInUse`
`private static boolean` | `DEFAULT_USE_CACHE` Default value for cacheInUse.
`protected IEntityStore` | `entityFactory`
`protected IEntitySearcher` | `entitySearcher`
`protected IEntityGroupStore` | `groupFactory`
`private static org.apache.commons.logging.Log` | `log`
`protected static IGroupService` | `singleton`

Constructor Summary
`private` | `ReferenceGroupService()` ReferenceGroupsService constructor.

Method Summary
`protected void` | `addGroupToCache(IEntityGroup group)`
`protected boolean` | `cacheInUse()` Answers if `IGroupMembers` are being cached.
`void` | `deleteGroup(IEntityGroup group)` Removes the `IEntityGroup` from the cache and the store.
`void` | `deleteGroup(ILockableEntityGroup group)` Removes the `ILockableEntityGroup` from the cache and the store.
`private EntityIdentifier[]` | `filterEntities(EntityIdentifier[] entities, IEntityGroup ancestor)`
`java.util.Iterator` | `findContainingGroups(IGroupMember gm)` Returns and caches the containing groups for the `IGroupMember`
`IEntityGroup` | `findGroup(java.lang.String key)` Returns a pre-existing `IEntityGroup` or null if it does not exist.
`protected IEntityGroup` | `findGroupWithCache(java.lang.String key)` Returns a pre-existing `IEntityGroup` or null if it does not exist.
`ILockableEntityGroup` | `findGroupWithLock(java.lang.String key, java.lang.String owner)` Returns a pre-existing `ILockableEntityGroup` or null if the group is not found.
`ILockableEntityGroup` | `findGroupWithLock(java.lang.String key, java.lang.String owner, int secs)` Returns a pre-existing `ILockableEntityGroup` or null if the group is not found.
`java.util.Iterator` | `findMemberGroups(IEntityGroup eg)` Returns and caches the member groups for the `IEntityGroup`
`IEntityGroup` | `getDistinguishedGroup(java.lang.String name)` Refers to the PropertiesManager to get the key for the group associated with 'name' and asks the group store implementation for the corresponding `IEntityGroup`.
`IEntity` | `getEntity(java.lang.String key, java.lang.Class type)` Returns an `IEntity` representing a portal entity.
`protected IEntityGroup` | `getGroupFromCache(java.lang.String key)` Returns a cached `IEntityGroup` or null if it has not been cached.
`IGroupMember` | `getGroupMember(EntityIdentifier underlyingEntityIdentifier)` Returns an `IGroupMember` representing either a group or a portal entity, based on the `EntityIdentifier`, which refers to the UNDERLYING entity for the `IGroupMember`.
`IGroupMember` | `getGroupMember(java.lang.String key, java.lang.Class type)` Returns an `IGroupMember` representing either a group or a portal entity.
`IEntityGroupStore` | `getGroupStore()` Returns the implementation of `IEntityGroupStore` whose class name was retrieved by the PropertiesManager (see initialize()).
`IEntityGroup` | `getRootGroup(java.lang.Class type)` Refers to the PropertiesManager to get the key for the root group associated with 'type' and asks the group store implementation for the corresponding `IEntityGroup`.
`private void` | `initialize()`
`IEntityGroup` | `newGroup(java.lang.Class type)` Returns a new `IEntityGroup` for the given Class with an unused key.
`private EntityIdentifier[]` | `removeDuplicates(EntityIdentifier[] entities)`
`protected void` | `removeGroupFromCache(IEntityGroup group)`
`EntityIdentifier[]` | `searchForEntities(java.lang.String query, int method, java.lang.Class type)` Find EntityIdentifiers for entities whose name matches the query string according to the specified method and is of the specified type
`EntityIdentifier[]` | `searchForEntities(java.lang.String query, int method, java.lang.Class type, IEntityGroup ancestor)` Find EntityIdentifiers for entities whose name matches the query string according to the specified method, is of the specified type and descends from the specified group
`EntityIdentifier[]` | `searchForGroups(java.lang.String query, int method, java.lang.Class leaftype)` Find EntityIdentifiers for groups whose name matches the query string according to the specified method and matches the provided leaf type
`EntityIdentifier[]` | `searchForGroups(java.lang.String query, int method, java.lang.Class leaftype, IEntityGroup ancestor)` Find EntityIdentifiers for groups whose name matches the query string according to the specified method, has the provided leaf type and descends from the specified group
`static IGroupService` | `singleton()`
`void` | `updateGroup(IEntityGroup group)` Updates the cache and the store with the new `IEntityGroup`.
`void` | `updateGroup(ILockableEntityGroup group)` Updates the `ILockableEntityGroup` in the cache and the store.
`void` | `updateGroup(ILockableEntityGroup group, boolean renewLock)` Updates the `ILockableEntityGroup` in the store and removes it from the cache.
`protected void` | `updateGroupInCache(IEntityGroup group)`
`void` | `updateGroupMembers(IEntityGroup group)` Updates the cache and the store with the updated `IEntityGroup`.
`void` | `updateGroupMembers(ILockableEntityGroup group)` Updates the `ILockableEntityGroup` in the cache and the store.
`void` | `updateGroupMembers(ILockableEntityGroup group, boolean renewLock)` Updates the `ILockableEntityGroup` in the store and removes it from the cache.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    private static final org.apache.commons.logging.Log log

### DEFAULT_USE_CACHE

    private static final boolean DEFAULT_USE_CACHE

  Default value for cacheInUse. This value will be used when the corresponding property cannot be loaded.

  See Also:
    Constant Field Values

### singleton

    protected static IGroupService singleton

### entityFactory

    protected IEntityStore entityFactory

### groupFactory

    protected IEntityGroupStore groupFactory

### entitySearcher

    protected IEntitySearcher entitySearcher

### cacheInUse

    private boolean cacheInUse

Constructor Detail

### ReferenceGroupService

    private ReferenceGroupService()
                           throws GroupsException

  ReferenceGroupsService constructor.

  Throws:
    `GroupsException`

Method Detail

### addGroupToCache

    protected void addGroupToCache(IEntityGroup group)
                            throws CachingException

  Throws:
    `CachingException`

### cacheInUse

    protected boolean cacheInUse()

  Answers if `IGroupMembers` are being cached.

### deleteGroup

    public void deleteGroup(IEntityGroup group)
                     throws GroupsException

  Removes the `IEntityGroup` from the cache and the store.

  Specified by:
    `deleteGroup` in interface `IGroupService`
  Parameters:
    `group` - IEntityGroup
  Throws:
    `GroupsException`

### deleteGroup

    public void deleteGroup(ILockableEntityGroup group)
                     throws GroupsException

  Removes the `ILockableEntityGroup` from the cache and the store.

  Specified by:
    `deleteGroup` in interface `ILockableGroupService`
  Parameters:
    `group` - ILockableEntityGroup
  Throws:
    `GroupsException`

### findContainingGroups

    public java.util.Iterator findContainingGroups(IGroupMember gm)
                                            throws GroupsException

  Returns and caches the containing groups for the `IGroupMember`

  Specified by:
    `findContainingGroups` in interface `IGroupService`
  Parameters:
    `gm` - IGroupMember
  Throws:
    `GroupsException`

### findGroup

    public IEntityGroup findGroup(java.lang.String key)
                           throws GroupsException

  Returns a pre-existing `IEntityGroup` or null if it does not exist.

  Specified by:
    `findGroup` in interface `IGroupService`
  Throws:
    `GroupsException`

### findGroupWithCache

    protected IEntityGroup findGroupWithCache(java.lang.String key)
                                       throws GroupsException

  Returns a pre-existing `IEntityGroup` or null if it does not exist.

  Throws:
    `GroupsException`

### findGroupWithLock

    public ILockableEntityGroup findGroupWithLock(java.lang.String key,
                                                  java.lang.String owner)
                                           throws GroupsException

  Returns a pre-existing `ILockableEntityGroup` or null if the group is not found.

  Specified by:
    `findGroupWithLock` in interface `ILockableGroupService`
  Parameters:
    `key` - String - the group key.
    `owner` - String - the lock owner.
  Returns:
    org.jasig.portal.groups.ILockableEntityGroup
  Throws:
    `GroupsException`

### findGroupWithLock

    public ILockableEntityGroup findGroupWithLock(java.lang.String key,
                                                  java.lang.String owner,
                                                  int secs)
                                           throws GroupsException

  Returns a pre-existing `ILockableEntityGroup` or null if the group is not found.

  Specified by:
    `findGroupWithLock` in interface `ILockableGroupService`
  Parameters:
    `key` - String - the group key.
    `owner` - String - the lock owner.
    `secs` - int - the duration of the lock in seconds.
  Returns:
    org.jasig.portal.groups.ILockableEntityGroup
  Throws:
    `GroupsException`

### findMemberGroups

    public java.util.Iterator findMemberGroups(IEntityGroup eg)
                                        throws GroupsException

  Returns and caches the member groups for the `IEntityGroup`

  Specified by:
    `findMemberGroups` in interface `IGroupService`
  Parameters:
    `eg` - IEntityGroup
  Throws:
    `GroupsException`

### getDistinguishedGroup

    public IEntityGroup getDistinguishedGroup(java.lang.String name)
                                       throws GroupsException

  Refers to the PropertiesManager to get the key for the group associated with 'name' and asks the group store implementation for the corresponding `IEntityGroup`.

  Throws:
    `GroupsException`

### getEntity

    public IEntity getEntity(java.lang.String key,
                             java.lang.Class type)
                      throws GroupsException

  Returns an `IEntity` representing a portal entity. This does not guarantee that the entity actually exists.

  Specified by:
    `getEntity` in interface `IGroupService`
  Throws:
    `GroupsException`

### getGroupFromCache

    protected IEntityGroup getGroupFromCache(java.lang.String key)
                                      throws CachingException

  Returns a cached `IEntityGroup` or null if it has not been cached.

  Throws:
    `CachingException`

### getGroupMember

    public IGroupMember getGroupMember(EntityIdentifier underlyingEntityIdentifier)
                                throws GroupsException

  Returns an `IGroupMember` representing either a group or a portal entity, based on the `EntityIdentifier`, which refers to the UNDERLYING entity for the `IGroupMember`.

  Specified by:
    `getGroupMember` in interface `IGroupService`
  Throws:
    `GroupsException`

### getGroupMember

    public IGroupMember getGroupMember(java.lang.String key,
                                       java.lang.Class type)
                                throws GroupsException

  Returns an `IGroupMember` representing either a group or a portal entity. If the parm `type` is the group type, the `IGroupMember` is an `IEntityGroup` else it is an `IEntity`.

  Specified by:
    `getGroupMember` in interface `IGroupService`
  Throws:
    `GroupsException`

### getGroupStore

    public IEntityGroupStore getGroupStore()
                                    throws GroupsException

  Returns the implementation of `IEntityGroupStore` whose class name was retrieved by the PropertiesManager (see initialize()).

  Specified by:
    `getGroupStore` in interface `IGroupService`
  Throws:
    `GroupsException`

### getRootGroup

    public IEntityGroup getRootGroup(java.lang.Class type)
                              throws GroupsException

  Refers to the PropertiesManager to get the key for the root group associated with 'type' and asks the group store implementation for the corresponding `IEntityGroup`.

  Throws:
    `GroupsException`

### initialize

    private void initialize()
                     throws GroupsException

  Throws:
    `GroupsException`

### newGroup

    public IEntityGroup newGroup(java.lang.Class type)
                          throws GroupsException

  Returns a new `IEntityGroup` for the given Class with an unused key.

  Specified by:
    `newGroup` in interface `IGroupService`
  Throws:
    `GroupsException`

### removeGroupFromCache

    protected void removeGroupFromCache(IEntityGroup group)
                                 throws CachingException

  Throws:
    `CachingException`

### singleton

    public static IGroupService singleton()
                                   throws GroupsException

  Returns:
    org.jasig.portal.groups.IGroupService
  Throws:
    `GroupsException`

### updateGroup

    public void updateGroup(IEntityGroup group)
                     throws GroupsException

  Updates the cache and the store with the new `IEntityGroup`.

  Specified by:
    `updateGroup` in interface `IGroupService`
  Parameters:
    `group` - IEntityGroup
  Throws:
    `GroupsException`

### updateGroup

    public void updateGroup(ILockableEntityGroup group)
                     throws GroupsException

  Updates the `ILockableEntityGroup` in the cache and the store.

  Specified by:
    `updateGroup` in interface `ILockableGroupService`
  Parameters:
    `group` - ILockableEntityGroup
  Throws:
    `GroupsException`

### updateGroup

    public void updateGroup(ILockableEntityGroup group,
                            boolean renewLock)
                     throws GroupsException

  Updates the `ILockableEntityGroup` in the store and removes it from the cache.

  Specified by:
    `updateGroup` in interface `ILockableGroupService`
  Parameters:
    `group` - ILockableEntityGroup
  Throws:
    `GroupsException`

### updateGroupInCache

    protected void updateGroupInCache(IEntityGroup group)
                               throws CachingException

  Throws:
    `CachingException`

### updateGroupMembers

    public void updateGroupMembers(IEntityGroup group)
                            throws GroupsException

  Updates the cache and the store with the updated `IEntityGroup`.

  Specified by:
    `updateGroupMembers` in interface `IGroupService`
  Parameters:
    `group` - IEntityGroup
  Throws:
    `GroupsException`

### updateGroupMembers

    public void updateGroupMembers(ILockableEntityGroup group)
                            throws GroupsException

  Updates the `ILockableEntityGroup` in the cache and the store.

  Specified by:
    `updateGroupMembers` in interface `ILockableGroupService`
  Parameters:
    `group` - ILockableEntityGroup
  Throws:
    `GroupsException`

### updateGroupMembers

    public void updateGroupMembers(ILockableEntityGroup group,
                                   boolean renewLock)
                            throws GroupsException

  Updates the `ILockableEntityGroup` in the store and removes it from the cache.

  Specified by:
    `updateGroupMembers` in interface `ILockableGroupService`
  Parameters:
    `group` - ILockableEntityGroup
  Throws:
    `GroupsException`

### searchForGroups

    public EntityIdentifier[] searchForGroups(java.lang.String query,
                                              int method,
                                              java.lang.Class leaftype)
                                       throws GroupsException

  Description copied from interface: `IGroupService`
  Find EntityIdentifiers for groups whose name matches the query string according to the specified method and matches the provided leaf type

  Specified by:
    `searchForGroups` in interface `IGroupService`
  Throws:
    `GroupsException`

### searchForGroups

    public EntityIdentifier[] searchForGroups(java.lang.String query,
                                              int method,
                                              java.lang.Class leaftype,
                                              IEntityGroup ancestor)
                                       throws GroupsException

  Description copied from interface: `IGroupService`
  Find EntityIdentifiers for groups whose name matches the query string according to the specified method, has the provided leaf type and descends from the specified group

  Specified by:
    `searchForGroups` in interface `IGroupService`
  Throws:
    `GroupsException`

### searchForEntities

    public EntityIdentifier[] searchForEntities(java.lang.String query,
                                                int method,
                                                java.lang.Class type)
                                         throws GroupsException

  Description copied from interface: `IGroupService`
  Find EntityIdentifiers for entities whose name matches the query string according to the specified method and is of the specified type

  Specified by:
    `searchForEntities` in interface `IGroupService`
  Throws:
    `GroupsException`

### searchForEntities

    public EntityIdentifier[] searchForEntities(java.lang.String query,
                                                int method,
                                                java.lang.Class type,
                                                IEntityGroup ancestor)
                                         throws GroupsException

  Description copied from interface: `IGroupService`
  Find EntityIdentifiers for entities whose name matches the query string according to the specified method, is of the specified type and descends from the specified group

  Specified by:
    `searchForEntities` in interface `IGroupService`
  Throws:
    `GroupsException`

### filterEntities

    private EntityIdentifier[] filterEntities(EntityIdentifier[] entities,
                                              IEntityGroup ancestor)
                                       throws GroupsException

  Throws:
    `GroupsException`

### removeDuplicates

    private EntityIdentifier[] removeDuplicates(EntityIdentifier[] entities)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD