Class AuthorizationCache

Description

This class provides a mechanism for caching different authorization components and also acts as an interface between the datastructures and the database.

  • version: $Id: AuthorizationCache.class.php,v 1.33 2007/09/13 16:04:18 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/oki2/authorization/AuthorizationCache.class.php (line 16)


	
			
Variable Summary
Method Summary
AuthorizationCache AuthorizationCache (mixed $dbIndex)
ref createAuthorization (ref $agentId, ref $functionId, ref $qualifierId, [object DateAndTime $effectiveDate = NULL], [object DateAndTime $expirationDate = NULL])
ref createFunction (ref $functionId, string $displayName, string $description, ref $functionType, ref $qualifierHierarchyId)
Qualifier createQualifier (ref $qualifierId, string $displayName, string $description, ref $qualifierType, ref $parentId)
ref createRootQualifier (ref $qualifierId, string $displayName, string $description, ref $qualifierType, ref $qualifierHierarchyId)
void deleteAuthorization (ref $authorization)
void deleteFunction (ref $functionId)
void deleteQualifier (ref $qualifierId)
ref getAZs (string $aId, string $fId, string $qId, object fType $fType, boolean $returnExplicitOnly, boolean $searchUp, boolean $isActiveNow, [mixed $groupIds = array()])
ref getFunction (string $idValue)
ref getFunctions (ref $functionType)
ref getFunctionTypes (ref 0)
ref getQualifier (string $qualifierId)
ref getQualifierDescendants (string $qualifierId)
object QualifierIterator getRootQualifiers (object qualifierHierarchyId $qualifierHierarchyId)
Variables
array $_authorizations (line 42)

An array of the cached Authorization objects. The index of each element is the Id of the corresponding Authorization.

  • var: _authorizations
  • access: protected
integer $_dbIndex (line 50)

The database connection as returned by the DBHandler.

  • var: _dbIndex
  • access: protected
array $_functions (line 33)

An array of the cached Function objects. The index of each element is the Id of the corresponding Function.

  • var: _functions
  • access: protected
array $_qualifiers (line 24)

An array of the cached Qualifier objects. The index of each element is the Id of the corresponding Qualifier.

  • var: _qualifiers
  • access: protected
Methods
Constructor AuthorizationCache (line 56)

Constructor

  • access: protected
AuthorizationCache AuthorizationCache (mixed $dbIndex)
createAuthorization (line 79)

Creates a new Authorization object, caches it, and inserts it into the database.

  • return: object Authorization
  • access: public
ref createAuthorization (ref $agentId, ref $functionId, ref $qualifierId, [object DateAndTime $effectiveDate = NULL], [object DateAndTime $expirationDate = NULL])
  • ref $agentId: object agentId who is authorized to perform this Function for this Qualifer and its descendants
  • ref $functionId: object functionId the Id of the Function for this Authorization
  • ref $qualifierId: object qualifierId the Id of the Qualifier for this Authorization
  • object DateAndTime $effectiveDate: effectiveDate when the Authorization becomes effective
  • object DateAndTime $expirationDate: expirationDate when the Authorization stops being effective
createFunction (line 157)

Creates a new Function, insertsi in the DB and caches it.

  • return: object Function
ref createFunction (ref $functionId, string $displayName, string $description, ref $functionType, ref $qualifierHierarchyId)
  • ref $functionId: object functionId is externally defined
  • string $displayName: displayName the name to display for this Function
  • string $description: description the description of this Function
  • ref $functionType: object functionType the Type of this Function
  • ref $qualifierHierarchyId: object qualifierHierarchyId the Id of the Qualifier Hierarchy associated with this Function
createQualifier (line 292)

Creates a new Qualifier in the Authorization Service. This is different than making a new instance of a Qualifier object locally as the Qualifier will be inserted into the Authorization Service.

  • throws: osid.authorization.AuthorizationException An exception with one of the following messages defined in osid.authorization.AuthorizationException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID, UNKNOWN_TYPE
Qualifier createQualifier (ref $qualifierId, string $displayName, string $description, ref $qualifierType, ref $parentId)
  • ref $qualifierId: object qualifierId is externally defined
  • string $displayName: displayName the name to display for this Qualifier
  • string $description: description the description of this Qualifier
  • ref $qualifierType: object qualifierType the Type of this Qualifier
  • ref $parentId: object parentId the parent of this Qualifier
createRootQualifier (line 258)

Creates a new Qualifier in the Authorization Service that has no parent. This is different from making a new instance of a Qualifier object locally as the Qualifier will be inserted into the Authorization Service.

  • return: object Qualifier
ref createRootQualifier (ref $qualifierId, string $displayName, string $description, ref $qualifierType, ref $qualifierHierarchyId)
  • ref $qualifierId: object qualifierId is externally defined
  • string $displayName: displayName the name to display for this Qualifier
  • string $description: description the description of this Qualifier
  • ref $qualifierType: object qualifierType the Type of this Qualifier
  • ref $qualifierHierarchyId: object qualifierHierarchyId the Id of the Qualifier Hierarchy associated with this Qualifier
deleteAuthorization (line 609)

Deletes the given Authorization.

  • access: public
void deleteAuthorization (ref $authorization)
  • ref $authorization: object authorization The Authorization to delete.
deleteFunction (line 673)

Deletes the given Authorization.

  • access: public
void deleteFunction (ref $functionId)
  • ref $functionId: object authorization The Authorization to delete.
deleteQualifier (line 646)

Deletes the given Authorization.

  • access: public
void deleteQualifier (ref $qualifierId)
  • ref $qualifierId: object authorization The Authorization to delete.
getAZs (line 718)

Auxilliary private function that returns Authorizations according to a

criteria. Null values are interpreted as wildmarks. Warning: $returnExplicitOnly = false will increase the running time significantly - USE SPARINGLY!

  • return: object An AuthorizationIterator.
  • access: public
ref getAZs (string $aId, string $fId, string $qId, object fType $fType, boolean $returnExplicitOnly, boolean $searchUp, boolean $isActiveNow, [mixed $groupIds = array()])
  • string $aId: aId The string id of an agent.
  • string $fId: fId The string id of a function.
  • string $qId: qId The string id of a qualifier. This parameter can not be null and used as a wildmark.
  • object fType $fType: The type of a function.
  • boolean $returnExplicitOnly: returnExplicitOnly If True, only explicit Authorizations will be returned.
  • boolean $searchUp: searchUp If true, the ancester nodes of the qualifier will be checked as well
  • boolean $isActiveNow: isActiveNow If True, only active Authorizations will be returned.
getFunction (line 444)

Returns the Function with the specified id.

  • return: object The Function with the specified id.
  • access: public
ref getFunction (string $idValue)
  • string $idValue: id The id of the function.
getFunctions (line 368)

Get all the Function of the specified Type.

  • return: object FunctionIterator
ref getFunctions (ref $functionType)
  • ref $functionType: object functionType the Type of the Functions to return
getFunctionTypes (line 324)

Get all the Function of the specified Type.

  • return: object FunctionIterator
ref getFunctionTypes (ref 0)
  • ref 0: object functionType the Type of the Functions to return
getQualifier (line 502)

Returns the Qualifier with the specified id.

  • return: object The Qualifier with the specified id.
  • access: public
ref getQualifier (string $qualifierId)
  • string $qualifierId: id The id of the Qualifier .
getQualifierDescendants (line 564)

Returns the Qualifier with the specified id.

  • return: object The Qualifier with the specified id.
  • access: public
ref getQualifierDescendants (string $qualifierId)
  • string $qualifierId: id The id of the Qualifier .
getRootQualifiers (line 531)

Given a QualifierHierarchy Id, returns the Qualifier that is the root of the tree of Qualifiers of this Type.

object QualifierIterator getRootQualifiers (object qualifierHierarchyId $qualifierHierarchyId)
  • object qualifierHierarchyId $qualifierHierarchyId

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