org.jasig.portal.groups
Class ReferenceCompositeGroupService

java.lang.Object
  extended by org.jasig.portal.groups.ReferenceComponentGroupService
      extended by org.jasig.portal.groups.ReferenceCompositeGroupService
All Implemented Interfaces:
IComponentGroupService, ICompositeGroupService
Direct Known Subclasses:
ReferenceIndividualGroupService

public class ReferenceCompositeGroupService
extends ReferenceComponentGroupService
implements ICompositeGroupService

Version:
$Revision: 1.12 $
Author:
Dan Ellentuck

Field Summary
protected  IIndividualGroupService defaultService
           
protected  IEntityStore entityFactory
           
 
Fields inherited from class org.jasig.portal.groups.ReferenceComponentGroupService
componentServices, serviceName
 
Constructor Summary
ReferenceCompositeGroupService()
          ReferenceCompositeGroupService constructor comment.
 
Method Summary
protected  void cacheAdd(IGroupMember gm)
           
protected  void cacheRemove(IGroupMember gm)
           
protected  void cacheUpdate(IGroupMember gm)
           
 java.util.Iterator findContainingGroups(IGroupMember gm)
          Returns groups that contain the IGroupMember.
 IEntityGroup findGroup(java.lang.String key)
          Returns a pre-existing IEntityGroup or null if the IGroupMember does not exist.
 ILockableEntityGroup findGroupWithLock(java.lang.String key, java.lang.String lockOwner)
          Returns a pre-existing IEntityGroup or null if the IGroupMember does not exist.
protected  IIndividualGroupService getComponentService(CompositeEntityIdentifier entId)
           
protected  IIndividualGroupService getComponentService(javax.naming.Name serviceName)
           
protected  IIndividualGroupService getDefaultService()
          Returns the IIndividualGroupService designated as the default service in the configuration document.
 IEntity getEntity(java.lang.String key, java.lang.Class type)
          Returns an IEntity representing a portal entity.
 IEntity getEntity(java.lang.String key, java.lang.Class type, java.lang.String svcName)
          Returns an IEntity representing a portal entity.
protected  IEntity getEntityFromCache(java.lang.String key)
          Returns a cached IEntity 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.
protected  void initializeComponentServices()
          Assembles the group services composite.
protected  CompositeEntityIdentifier newCompositeEntityIdentifier(java.lang.String key)
          Returns a CompositeEntityIdentifier for the group identified by key.
 IEntityGroup newGroup(java.lang.Class type, javax.naming.Name serviceName)
          Returns a new IEntityGroup from the named service.
protected  IEntityGroup primFindGroup(java.lang.String key)
          Returns a pre-existing IEntityGroup or null if the IGroupMember does not exist.
 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
protected  void setComponentServices(java.util.Map newComponentServices)
          Insert the method's description here.
 
Methods inherited from class org.jasig.portal.groups.ReferenceComponentGroupService
getComponentServices, getServiceName, isLeafService, setServiceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.portal.groups.IComponentGroupService
getComponentServices, getServiceName, isLeafService, setServiceName
 

Field Detail

entityFactory

protected IEntityStore entityFactory

defaultService

protected IIndividualGroupService defaultService
Constructor Detail

ReferenceCompositeGroupService

public ReferenceCompositeGroupService()
                               throws GroupsException
ReferenceCompositeGroupService constructor comment.

Throws:
GroupsException
Method Detail

findContainingGroups

public java.util.Iterator findContainingGroups(IGroupMember gm)
                                        throws GroupsException
Returns groups that contain the IGroupMember. Delegates to the component services, but only after checking that they might actually contain a membership for this member.

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

findGroup

public IEntityGroup findGroup(java.lang.String key)
                       throws GroupsException
Returns a pre-existing IEntityGroup or null if the IGroupMember does not exist.

Specified by:
findGroup in interface ICompositeGroupService
Throws:
GroupsException

findGroupWithLock

public ILockableEntityGroup findGroupWithLock(java.lang.String key,
                                              java.lang.String lockOwner)
                                       throws GroupsException
Returns a pre-existing IEntityGroup or null if the IGroupMember does not exist.

Specified by:
findGroupWithLock in interface ICompositeGroupService
Throws:
GroupsException

getComponentService

protected IIndividualGroupService getComponentService(javax.naming.Name serviceName)
Returns:
IIndividualGroupService

getComponentService

protected IIndividualGroupService getComponentService(CompositeEntityIdentifier entId)
Returns:
IIndividualGroupService

getDefaultService

protected IIndividualGroupService getDefaultService()
Returns the IIndividualGroupService designated as the default service in the configuration document.


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 ICompositeGroupService
Throws:
GroupsException

getEntity

public IEntity getEntity(java.lang.String key,
                         java.lang.Class type,
                         java.lang.String svcName)
                  throws GroupsException
Returns an IEntity representing a portal entity. This does not guarantee that the entity actually exists.

Specified by:
getEntity in interface ICompositeGroupService
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 ICompositeGroupService
Throws:
GroupsException

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 ICompositeGroupService
Throws:
GroupsException

initializeComponentServices

protected void initializeComponentServices()
                                    throws GroupsException
Assembles the group services composite. Once the leaf services have been retrieved, they are held in a (one-dimensional) Map. The composite identity of a service is preserved in its Map key, a javax.naming.Name. Each node of the Name is the name of a component service, starting with the service closest to the composite service and ending with the name of the leaf service. The key is built up layer by layer.

Throws:
GroupsException

newCompositeEntityIdentifier

protected CompositeEntityIdentifier newCompositeEntityIdentifier(java.lang.String key)
                                                          throws GroupsException
Returns a CompositeEntityIdentifier for the group identified by key.

Throws:
GroupsException

newGroup

public IEntityGroup newGroup(java.lang.Class type,
                             javax.naming.Name serviceName)
                      throws GroupsException
Returns a new IEntityGroup from the named service.

Specified by:
newGroup in interface ICompositeGroupService
Throws:
GroupsException

primFindGroup

protected IEntityGroup primFindGroup(java.lang.String key)
                              throws GroupsException
Returns a pre-existing IEntityGroup or null if the IGroupMember does not exist.

Throws:
GroupsException

searchForEntities

public EntityIdentifier[] searchForEntities(java.lang.String query,
                                            int method,
                                            java.lang.Class type)
                                     throws GroupsException
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 ICompositeGroupService
Throws:
GroupsException

searchForEntities

public EntityIdentifier[] searchForEntities(java.lang.String query,
                                            int method,
                                            java.lang.Class type,
                                            IEntityGroup ancestor)
                                     throws GroupsException
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 ICompositeGroupService
Throws:
GroupsException

searchForGroups

public EntityIdentifier[] searchForGroups(java.lang.String query,
                                          int method,
                                          java.lang.Class leaftype)
                                   throws GroupsException
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 ICompositeGroupService
Throws:
GroupsException

searchForGroups

public EntityIdentifier[] searchForGroups(java.lang.String query,
                                          int method,
                                          java.lang.Class leaftype,
                                          IEntityGroup ancestor)
                                   throws GroupsException
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 ICompositeGroupService
Throws:
GroupsException

setComponentServices

protected void setComponentServices(java.util.Map newComponentServices)
Insert the method's description here. Creation date: (10/31/2002 10:58:53 AM)

Parameters:
newComponentServices - java.util.Map

cacheAdd

protected void cacheAdd(IGroupMember gm)
                 throws GroupsException
Throws:
GroupsException

cacheRemove

protected void cacheRemove(IGroupMember gm)
                    throws GroupsException
Throws:
GroupsException

cacheUpdate

protected void cacheUpdate(IGroupMember gm)
                    throws GroupsException
Throws:
GroupsException

getEntityFromCache

protected IEntity getEntityFromCache(java.lang.String key)
                              throws CachingException
Returns a cached IEntity or null if it has not been cached.

Throws:
CachingException