Class HarmoniAgentManager

Description

<p> AgentManager handles creating, deleting, and getting Agents and Groups.

Group is a subclass of Agent. Groups contain members. Group members are Agents or other Groups. </p>

<p> All implementations of OsidManager (manager) provide methods for accessing and manipulating the various objects defined in the OSID package. A manager defines an implementation of an OSID. All other OSID objects come either directly or indirectly from the manager. New instances of the OSID objects are created either directly or indirectly by the manager. Because the OSID objects are defined using interfaces, create methods must be used instead of the new operator to create instances of the OSID objects. Create methods are used both to instantiate and persist OSID objects. Using the OsidManager class to define an OSID's implementation allows the application to change OSID implementations by changing the OsidManager package name used to load an implementation. Applications developed using managers permit OSID implementation substitution without changing the application source code. As with all managers, use the OsidLoader to load an implementation of this interface. </p>

  • author: Adam Franco
  • author: Dobromir Radichkov
  • version: $Id: HarmoniAgentManager.class.php,v 1.48 2007/09/13 16:04:17 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright &copy; 2005, Middlebury College

Located in /harmoni/core/oki2/agent/HarmoniAgentManager.class.php (line 58)

OsidManager
   |
   --AgentManager
      |
      --HarmoniAgentManager
Variable Summary
string $_agentFlavor
Method Summary
HarmoniAgentManager HarmoniAgentManager ()
void assignConfiguration (object Properties $configuration)
void assignOsidContext (mixed $context, object OsidContext $context )
boolean changeAgentFlavor (mixed $agentFlavor, string $agentFlavor )
object Agent createAgent (string $displayName, object Type $agentType, object Properties $properties, [optional $agentId = null])
object Group createGroup (string $displayName, object Type $groupType, string $description, mixed $properties, [mixed $id = null], object Properties $properties )
void deleteAgent (mixed $id, object Id $id )
void deleteGroup (mixed $id, object Id $id )
object Agent getAgent (mixed $id, object Id $id )
string getAgentFlavor ()
ref getAgentOrGroup (ref $id)
object AgentIterator getAgents ()
object AgentIterator getAgentsBySearch (object mixed $searchCriteria, mixed $agentSearchType, object Type $agentSearchType )
object AgentIterator getAgentsByType (mixed $agentType, object Type $agentType )
object TypeIterator getAgentSearchTypes ()
object TypeIterator getAgentTypes ()
object Group getGroup (mixed $id, object Id $id )
object AgentIterator getGroups ()
object AgentIterator getGroupsBySearch (object mixed $searchCriteria, mixed $groupSearchType, object Type $groupSearchType )
object AgentIterator getGroupsByType (mixed $groupType, object Type $groupType )
object TypeIterator getGroupSearchTypes ()
object TypeIterator getGroupTypes ()
object OsidContext getOsidContext ()
object TypeIterator getPropertyTypes ()
boolean isAgent (object Id $id)
boolean isGroup (object Id $id)
Variables
string $_agentFlavor (line 70)

Whether to use plain agents or editable agents. 'Flavor' is used because

it would be confusing to use the word 'type' because of the specific use of the OSID Type concept

  • var: _agentFlavor
  • access: private
Methods
Constructor HarmoniAgentManager (line 75)

Constructor. Set up any database connections needed.

HarmoniAgentManager HarmoniAgentManager ()
assignConfiguration (line 107)

Assign the configuration of this Manager. Valid configuration options are as

follows: database_index integer database_name string

  • access: public
  • throws: object OsidException An exception with one of the following messages defined in org.osid.OsidException: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT
void assignConfiguration (object Properties $configuration)
  • object Properties $configuration: (original type: java.util.Properties)

Redefinition of:
OsidManager::assignConfiguration()
Assign the configuration of this OsidManager.
assignOsidContext (line 166)

Assign the context of this OsidManager.

  • access: public
  • throws: object OsidException An exception with one of the following messages defined in org.osid.OsidException: NULL_ARGUMENT
void assignOsidContext (mixed $context, object OsidContext $context )
  • object OsidContext $context

Redefinition of:
OsidManager::assignOsidContext()
Assign the context of this OsidManager.
changeAgentFlavor (line 181)

* WARNING: NOT IN OSID -- USE AT YOUR OWN RISK Change the flavor between editable agent and non editable agent

  • access: public
boolean changeAgentFlavor (mixed $agentFlavor, string $agentFlavor )
  • string $agentFlavor
createAgent (line 231)

Create an Agent with the display name, Type, and Properties specified.

Whether a HarmoniAgent or HarmoniEditableAgent is created depends on the flavor.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object Agent createAgent (string $displayName, object Type $agentType, object Properties $properties, [optional $agentId = null])
  • string $displayName
  • object Type $agentType
  • object Properties $properties
  • optional $agentId: object Id $id WARNING: NOT IN OSID -- USE AT YOUR OWN RISK

Redefinition of:
AgentManager::createAgent()
Create an Agent with the display name, Type, and Properties specified.
createGroup (line 527)

Create a Group with the display name, Type, description, and Properties specified. All but description are immutable.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object Group createGroup (string $displayName, object Type $groupType, string $description, mixed $properties, [mixed $id = null], object Properties $properties )
  • string $displayName
  • object Type $groupType
  • string $description
  • object Properties $properties

Redefinition of:
AgentManager::createGroup()
Create a Group with the display name, Type, description, and Properties specified. All but description are immutable.
deleteAgent (line 290)

Delete the Agent with the specified unique Id.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
void deleteAgent (mixed $id, object Id $id )
  • object Id $id

Redefinition of:
AgentManager::deleteAgent()
Delete the Agent with the specified unique Id.
deleteGroup (line 597)

Delete the Group with the specified unique Id.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
void deleteGroup (mixed $id, object Id $id )
  • object Id $id

Redefinition of:
AgentManager::deleteGroup()
Delete the Group with the specified unique Id.
getAgent (line 329)

Get the Agent with the specified unique Id. Getting an Agent by name is not supported since names are not guaranteed to be unique.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
object Agent getAgent (mixed $id, object Id $id )
  • object Id $id

Redefinition of:
AgentManager::getAgent()
Get the Agent with the specified unique Id. Getting an Agent by name is not supported since names are not guaranteed to be unique.
getAgentFlavor (line 198)

* WARNING: NOT IN OSID -- USE AT YOUR OWN RISK Returns the agent flavor

  • access: public
string getAgentFlavor ()
getAgentOrGroup (line 959)

Returns an Agent or Group object, depending on what type of agent the passed id refers to.

WARNING: NOT IN OSID - This method is not part of the OSIDs as of Version 2.0

  • return: object
ref getAgentOrGroup (ref $id)
  • ref $id: object Id
getAgents (line 366)

Get all the Agents. The returned iterator provides access to the Agents one at a time. Iterators have a method hasNextAgent() which returns

  1. true
if there is an Agent available and a method nextAgent() which returns the next Agent.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object AgentIterator getAgents ()

Redefinition of:
AgentManager::getAgents()
Get all the Agents. The returned iterator provides access to the Agents one at a time. Iterators have a method hasNextAgent() which returns
  1. true
if there is an Agent available and a method nextAgent() which returns the next Agent.
getAgentsBySearch (line 401)

Get all the Agents with the specified search criteria and search Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object AgentIterator getAgentsBySearch (object mixed $searchCriteria, mixed $agentSearchType, object Type $agentSearchType )
  • object mixed $searchCriteria: (original type: java.io.Serializable)
  • object Type $agentSearchType

Redefinition of:
AgentManager::getAgentsBySearch()
Get all the Agents with the specified search criteria and search Type.
getAgentsByType (line 886)

Get all the Agents of the specified Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object AgentIterator getAgentsByType (mixed $agentType, object Type $agentType )
  • object Type $agentType

Redefinition of:
AgentManager::getAgentsByType()
Get all the Agents of the specified Type.
getAgentSearchTypes (line 435)

Get all the agent search Types supported by this implementation.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object TypeIterator getAgentSearchTypes ()

Redefinition of:
AgentManager::getAgentSearchTypes()
Get all the agent search Types supported by this implementation.
getAgentTypes (line 470)

Get all the agent Types. The returned iterator provides access to the agent Types from this implementation one at a time. Iterators have a method hasNext() which returns true if there is an agent Type available and a method next() which returns the next agent Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getAgentTypes ()

Redefinition of:
AgentManager::getAgentTypes()
Get all the agent Types. The returned iterator provides access to the agent Types from this implementation one at a time. Iterators have a method hasNext() which returns true if there is an agent Type available and a method next() which returns the next agent Type.
getGroup (line 646)

Gets the Group with the specified unique Id. Getting a Group by name is not supported since names are not guaranteed to be unique.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
object Group getGroup (mixed $id, object Id $id )
  • object Id $id

Redefinition of:
AgentManager::getGroup()
Gets the Group with the specified unique Id. Getting a Group by name is not supported since names are not guaranteed to be unique.
getGroups (line 704)

Get all the Groups. Note since Groups subclass Agents, we are returning

an AgentIterator and there is no GroupIterator. the returned iterator provides access to the Groups one at a time. Iterators have a method hasNextAgent() which returns true if there is a Group available and a method nextAgent() which returns the next Group.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object AgentIterator getGroups ()

Redefinition of:
AgentManager::getGroups()
Get all the Groups. Note since Groups subclass Agents, we are returning
getGroupsBySearch (line 763)

Get all the groups with the specified search criteria and search Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object AgentIterator getGroupsBySearch (object mixed $searchCriteria, mixed $groupSearchType, object Type $groupSearchType )
  • object mixed $searchCriteria: (original type: java.io.Serializable)
  • object Type $groupSearchType

Redefinition of:
AgentManager::getGroupsBySearch()
Get all the groups with the specified search criteria and search Type.
getGroupsByType (line 913)

Get all the Groups of the specified Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object AgentIterator getGroupsByType (mixed $groupType, object Type $groupType )
  • object Type $groupType

Redefinition of:
AgentManager::getGroupsByType()
Get all the Groups of the specified Type.
getGroupSearchTypes (line 798)

Get all the group search types supported by this implementation.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object TypeIterator getGroupSearchTypes ()

Redefinition of:
AgentManager::getGroupSearchTypes()
Get all the group search types supported by this implementation.
getGroupTypes (line 833)

Get all the group Types. The returned iterator provides access to the group Types from this implementation one at a time. Iterators have a method hasNext() which returns true if there is a group Type available and a method next() which returns the next group Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getGroupTypes ()

Redefinition of:
AgentManager::getGroupTypes()
Get all the group Types. The returned iterator provides access to the group Types from this implementation one at a time. Iterators have a method hasNext() which returns true if there is a group Type available and a method next() which returns the next group Type.
getOsidContext (line 151)

Return context of this OsidManager.

  • access: public
  • throws: object OsidException
object OsidContext getOsidContext ()

Redefinition of:
OsidManager::getOsidContext()
Return context of this OsidManager.
getPropertyTypes (line 496)

Get all the property Types. The returned iterator provides access to

the property Types from this implementation one at a time. Iterators have a method hasNext() which returns true if there is another property Type available and a method next() which returns the next property Type.

  • access: public
  • throws: object AgentException An exception with one of the following messages defined in org.osid.agent.AgentException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getPropertyTypes ()

Redefinition of:
AgentManager::getPropertyTypes()
Get all the property Types. The returned iterator provides access to
isAgent (line 926)

Return TRUE if the Id specified corresponds to an agent.

WARNING: NOT IN OSID - This method is not part of the OSIDs as of Version 2.0

boolean isAgent (object Id $id)
  • object Id $id: agentId
isGroup (line 976)

Return TRUE if the Id specified corresponds to an group.

WARNING: NOT IN OSID - This method is not part of the OSIDs as of Version 2.0

boolean isGroup (object Id $id)
  • object Id $id: agentId

Inherited Methods

Inherited From AgentManager

AgentManager::createAgent()
AgentManager::createGroup()
AgentManager::deleteAgent()
AgentManager::deleteGroup()
AgentManager::getAgent()
AgentManager::getAgents()
AgentManager::getAgentsBySearch()
AgentManager::getAgentsByType()
AgentManager::getAgentSearchTypes()
AgentManager::getAgentTypes()
AgentManager::getGroup()
AgentManager::getGroups()
AgentManager::getGroupsBySearch()
AgentManager::getGroupsByType()
AgentManager::getGroupSearchTypes()
AgentManager::getGroupTypes()
AgentManager::getPropertyTypes()

Inherited From OsidManager

OsidManager::assignConfiguration()
OsidManager::assignOsidContext()
OsidManager::getOsidContext()
OsidManager::osidVersion_2_0()

Documentation generated on Wed, 19 Sep 2007 10:23:39 -0400 by phpDocumentor 1.3.0RC3