org.sakaiproject.component.common.agent
Class AgentGroupManagerUserDirectoryProxy

java.lang.Object
  extended byorg.sakaiproject.component.common.agent.AgentGroupManagerUserDirectoryProxy
All Implemented Interfaces:
AgentGroupManager, DefaultContainer, UuidTypeResolvable

public class AgentGroupManagerUserDirectoryProxy
extends Object
implements AgentGroupManager

Version:
$Id: AgentGroupManagerUserDirectoryProxy.java 5970 2006-02-15 03:07:19Z ggolden@umich.edu $
Author:
Lance Speelmon

Constructor Summary
AgentGroupManagerUserDirectoryProxy()
           
 
Method Summary
 Agent createAgent(Node parentNode, String enterpriseId, String displayName)
          Creates an Agent in the OU specified by parentNode, with a default Agent Type.
 Agent createAgent(Node parentNode, String sessionManagerUserId, String enterpriseId, String displayName, Type agentType)
          Creates an Agent with a Type specified by agentType, contained by the OU specified by parentNode.
 Agent createAgent(String displayName)
          Creates an Agent in the default Agent OU, with a default Agent Type.
 Agent createAgent(String enterpriseId, String displayName)
          Creates an Agent in the default Agent OU, with a default Agent Type.
 Group createGroup(Node parentNode, String displayName)
          Create a Group in the container specified by parentNode.
 Group createGroup(Node parentNode, String enterpriseId, String displayName, Type groupType)
          Provides the caller with full control over the location in the SuperStructure as well as the Group Type.
 Group createGroup(String displayName)
          Create a Group in the default OU with the default Group Type.
 Group createGroup(String displayName, Type groupType)
          Creates a new Group in the default OU container but gives caller control of Group Type.
 void delete(Agent agentOrGroup)
          Delete the Agent.
 void delete(String uuid)
          Delete the Agent by UUID.
 List findTransitiveDescendents(Group group)
          Find all transitive children for a given Group.
 List findTransitiveDescendents(Group group, boolean includeThisAgent)
          Find all transitive children for a given Group.
 Agent getAgent()
          Convenience method to get the currently logged in Agent
 Agent getAgentByEnterpriseId(String enterpriseId)
          Polymorphic retrieve will include both Agent and Group objects.
 Agent getAgentBySessionManagerUserId(String sessionManagerUserId)
          Retrieve an Agent by the unique id generated by SessionManager.
 Agent getAgentByUuid(String uuid)
          Polymorphic retrieve will include both Agent and Group objects.
 Group getAnonymousGroup()
          Returns a reference to a special Group.
 Group getAuthenticatedUsers()
          Returns a reference to a special Group.
 Type getDefaultAgentType()
          The default Type for an Agent
 Node getDefaultContainer()
          Specifies the default SuperStructure container where objects should be created.
 Type getDefaultGroupType()
          The default Type for a Group
 Group getGroupByEnterpriseId(String enterpriseId)
          Retrieve only objects of type Group.
 Group getGroupByUuid(String uuid)
          Retrieve only objects of type Group.
 Object getObject(String uuid, Type type)
          Provides an abstract way to retrieve objects from a Manager given only the object's UUID and Type.
 void save(Agent agentOrGroup)
          Persist an Agent or Group.
 void setUserDirectoryService(UserDirectoryService userDirectoryService)
          Dependency injection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentGroupManagerUserDirectoryProxy

public AgentGroupManagerUserDirectoryProxy()
Method Detail

createAgent

public Agent createAgent(String displayName)
Description copied from interface: AgentGroupManager
Creates an Agent in the default Agent OU, with a default Agent Type.

Specified by:
createAgent in interface AgentGroupManager
Parameters:
displayName -
Returns:
See Also:
AgentGroupManager.createAgent(java.lang.String)

createAgent

public Agent createAgent(String enterpriseId,
                         String displayName)
Description copied from interface: AgentGroupManager
Creates an Agent in the default Agent OU, with a default Agent Type.

Specified by:
createAgent in interface AgentGroupManager
Parameters:
enterpriseId - Enterprise username
displayName -
Returns:
See Also:
AgentGroupManager.createAgent(java.lang.String, java.lang.String)

createAgent

public Agent createAgent(Node parentNode,
                         String enterpriseId,
                         String displayName)
Description copied from interface: AgentGroupManager
Creates an Agent in the OU specified by parentNode, with a default Agent Type.

Specified by:
createAgent in interface AgentGroupManager
Parameters:
parentNode - The OU that will contain new Agent.
enterpriseId - Enterprise username
displayName -
Returns:
See Also:
AgentGroupManager.createAgent(org.sakaiproject.api.common.superstructure.Node, java.lang.String, java.lang.String)

createAgent

public Agent createAgent(Node parentNode,
                         String sessionManagerUserId,
                         String enterpriseId,
                         String displayName,
                         Type agentType)
Description copied from interface: AgentGroupManager
Creates an Agent with a Type specified by agentType, contained by the OU specified by parentNode.

Specified by:
createAgent in interface AgentGroupManager
Parameters:
parentNode - Container OU for new Agent.
sessionManagerUserId - The unique id from Session.getUserId()
enterpriseId -
displayName - Text that will presented in the UI
agentType - Caller specified Agent Type.
Returns:
See Also:
AgentGroupManager.createAgent(org.sakaiproject.api.common.superstructure.Node, java.lang.String, java.lang.String, java.lang.String, org.sakaiproject.api.common.type.Type)

createGroup

public Group createGroup(String displayName)
Description copied from interface: AgentGroupManager
Create a Group in the default OU with the default Group Type.

Specified by:
createGroup in interface AgentGroupManager
Parameters:
displayName -
Returns:
See Also:
AgentGroupManager.createGroup(java.lang.String)

createGroup

public Group createGroup(Node parentNode,
                         String displayName)
Description copied from interface: AgentGroupManager
Create a Group in the container specified by parentNode. Group is created with default Group Type.

Specified by:
createGroup in interface AgentGroupManager
Parameters:
parentNode - The newly created Group's parent.
displayName -
Returns:
See Also:
AgentGroupManager.createGroup(org.sakaiproject.api.common.superstructure.Node, java.lang.String)

createGroup

public Group createGroup(Node parentNode,
                         String enterpriseId,
                         String displayName,
                         Type groupType)
Description copied from interface: AgentGroupManager
Provides the caller with full control over the location in the SuperStructure as well as the Group Type.

Specified by:
createGroup in interface AgentGroupManager
Parameters:
parentNode - The newly created Group's parent.
enterpriseId -
displayName -
groupType -
Returns:
See Also:
AgentGroupManager.createGroup(org.sakaiproject.api.common.superstructure.Node, java.lang.String, java.lang.String, org.sakaiproject.api.common.type.Type)

createGroup

public Group createGroup(String displayName,
                         Type groupType)
Description copied from interface: AgentGroupManager
Creates a new Group in the default OU container but gives caller control of Group Type.

Specified by:
createGroup in interface AgentGroupManager
Parameters:
displayName -
groupType -
Returns:
See Also:
AgentGroupManager.createGroup(java.lang.String, org.sakaiproject.api.common.type.Type)

getAgent

public Agent getAgent()
Description copied from interface: AgentGroupManager
Convenience method to get the currently logged in Agent

Specified by:
getAgent in interface AgentGroupManager
Returns:
The currently logged in Agent
See Also:
AgentGroupManager.getAgent(), UserDirectoryService.getCurrentUser()

getAgentByUuid

public Agent getAgentByUuid(String uuid)
Description copied from interface: AgentGroupManager
Polymorphic retrieve will include both Agent and Group objects.

Specified by:
getAgentByUuid in interface AgentGroupManager
Parameters:
uuid -
Returns:
null if not found.
See Also:
AgentGroupManager.getAgentByUuid(java.lang.String)

getAgentByEnterpriseId

public Agent getAgentByEnterpriseId(String enterpriseId)
Description copied from interface: AgentGroupManager
Polymorphic retrieve will include both Agent and Group objects.

Specified by:
getAgentByEnterpriseId in interface AgentGroupManager
Parameters:
enterpriseId -
Returns:
null if not found.
See Also:
AgentGroupManager.getAgentByEnterpriseId(java.lang.String)

getAgentBySessionManagerUserId

public Agent getAgentBySessionManagerUserId(String sessionManagerUserId)
Description copied from interface: AgentGroupManager
Retrieve an Agent by the unique id generated by SessionManager.

Specified by:
getAgentBySessionManagerUserId in interface AgentGroupManager
Parameters:
sessionManagerUserId -
Returns:
See Also:
AgentGroupManager.getAgentBySessionManagerUserId(java.lang.String)

getGroupByUuid

public Group getGroupByUuid(String uuid)
Description copied from interface: AgentGroupManager
Retrieve only objects of type Group.

Specified by:
getGroupByUuid in interface AgentGroupManager
Parameters:
uuid -
Returns:
See Also:
AgentGroupManager.getGroupByUuid(java.lang.String)

getGroupByEnterpriseId

public Group getGroupByEnterpriseId(String enterpriseId)
Description copied from interface: AgentGroupManager
Retrieve only objects of type Group.

Specified by:
getGroupByEnterpriseId in interface AgentGroupManager
Parameters:
enterpriseId -
Returns:
See Also:
AgentGroupManager.getGroupByEnterpriseId(java.lang.String)

getAnonymousGroup

public Group getAnonymousGroup()
Description copied from interface: AgentGroupManager
Returns a reference to a special Group. The "Anonymous" Group virtually contains all known Agents; i.e. "Everyone" is a virtual member of this Group.

Specified by:
getAnonymousGroup in interface AgentGroupManager
Returns:
See Also:
AgentGroupManager.getAnonymousGroup()

getAuthenticatedUsers

public Group getAuthenticatedUsers()
Description copied from interface: AgentGroupManager
Returns a reference to a special Group. The "Authenticated Users" Group virtually contains all Agents which are authenticated or identifiable.

Specified by:
getAuthenticatedUsers in interface AgentGroupManager
Returns:
See Also:
AgentGroupManager.getAuthenticatedUsers()

findTransitiveDescendents

public List findTransitiveDescendents(Group group)
Description copied from interface: AgentGroupManager
Find all transitive children for a given Group. The passed Group will not be included in the results by default.

Specified by:
findTransitiveDescendents in interface AgentGroupManager
Parameters:
group -
Returns:
List of Agents
See Also:
AgentGroupManager.findTransitiveDescendents(org.sakaiproject.api.common.agent.Group)

findTransitiveDescendents

public List findTransitiveDescendents(Group group,
                                      boolean includeThisAgent)
Description copied from interface: AgentGroupManager
Find all transitive children for a given Group.

Specified by:
findTransitiveDescendents in interface AgentGroupManager
Parameters:
group -
includeThisAgent - TRUE == include passed Group in returned results. FALSE == do not include passed Group in results.
Returns:
List of Agents
See Also:
AgentGroupManager.findTransitiveDescendents(org.sakaiproject.api.common.agent.Group, boolean)

save

public void save(Agent agentOrGroup)
Description copied from interface: AgentGroupManager
Persist an Agent or Group.

Specified by:
save in interface AgentGroupManager
See Also:
AgentGroupManager.save(org.sakaiproject.api.common.agent.Agent)

delete

public void delete(Agent agentOrGroup)
Description copied from interface: AgentGroupManager
Delete the Agent.

Specified by:
delete in interface AgentGroupManager
Parameters:
agentOrGroup -
See Also:
AgentGroupManager.delete(org.sakaiproject.api.common.agent.Agent)

delete

public void delete(String uuid)
Description copied from interface: AgentGroupManager
Delete the Agent by UUID.

Specified by:
delete in interface AgentGroupManager
Parameters:
uuid -
See Also:
AgentGroupManager.delete(java.lang.String)

getDefaultAgentType

public Type getDefaultAgentType()
Description copied from interface: AgentGroupManager
The default Type for an Agent

Specified by:
getDefaultAgentType in interface AgentGroupManager
Returns:
See Also:
AgentGroupManager.getDefaultAgentType()

getDefaultGroupType

public Type getDefaultGroupType()
Description copied from interface: AgentGroupManager
The default Type for a Group

Specified by:
getDefaultGroupType in interface AgentGroupManager
Returns:
See Also:
AgentGroupManager.getDefaultGroupType()

getDefaultContainer

public Node getDefaultContainer()
                         throws UnsupportedOperationException
Description copied from interface: DefaultContainer
Specifies the default SuperStructure container where objects should be created. This will normally be used in the context of a Manager.

For example, the AgentGroupManager implementation should specify where objects it creates should be stored by default.

Specified by:
getDefaultContainer in interface DefaultContainer
Returns:
Throws:
UnsupportedOperationException - Some implementations may not support this method. Callers need to handle this condition gracefully.
See Also:
DefaultContainer.getDefaultContainer()

getObject

public Object getObject(String uuid,
                        Type type)
                 throws UnsupportedTypeException
Description copied from interface: UuidTypeResolvable
Provides an abstract way to retrieve objects from a Manager given only the object's UUID and Type.

Specified by:
getObject in interface UuidTypeResolvable
Parameters:
uuid - The universally unique identifier of the Object.
type - The Type of the Object.
Returns:
Throws:
UnsupportedTypeException - If the Manager does not support the passed Type.
See Also:
UuidTypeResolvable.getObject(java.lang.String, org.sakaiproject.api.common.type.Type)

setUserDirectoryService

public void setUserDirectoryService(UserDirectoryService userDirectoryService)
Dependency injection.

Parameters:
userDirectoryService - The userDirectoryService to set.