OSID Logo
OSID Specifications
authentication package
Version 3.0.0
Release Candidate Preview
Interfaceosid.authentication.AgentAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Agents. The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create an Agent, an AgentForm is requested using getAgentFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned AgentForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the AgentForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each AgentForm corresponds to an attempted transaction.

For updates, AgentForms are requested to the Agent Id that is to be updated using getAgentFormForUpdate(). Similarly, the AgentForm has metadata about the data that can be updated and it can perform validation before submitting the update. The AgentForm can only be used once for a successful update and cannot be reused.

The delete operations delete Agents. To unmap an Agent from the current Agency, the AgentAgencyAssignmentSession should be used. These delete operations attempt to remove the Agent itself thus removing it from all known Agency catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetAgencyId
Description

Gets the Agency Id associated with this session.

Returnosid.id.Idthe Agency Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetAgency
Description

Gets the Agency associated with this session.

Returnosid.authentication.Agencythe Agency associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateAgents
Description

Tests if this user can create Agents. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Agent will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Agent creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateAgentWithRecordTypes
Description

Tests if this user can create a single Agent using the desired record types. While AuthenticationManager.getAgentRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Agent. Providing an empty array tests if an Agent can be created with no records.

Parametersosid.type.Type[]agentRecordTypesarray of agent record types
Returnboolean true if Agent creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT agentRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAgentFormForCreate
Description

Gets the agent form for creating new agents. A new form should be requested for each create transaction.

Parametersosid.type.Type[]agentRecordTypesarray of agent record types
Returnosid.authentication.AgentFormthe agent form
ErrorsNULL_ARGUMENT agentRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAgent
Description

Creates a new Agent.

Parametersosid.authentication.AgentFormagentFormthe form for this Agent
Returnosid.authentication.Agentthe new Agent
ErrorsILLEGAL_STATE agentForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT agentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED agentForm did not originate from getAgentFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAgents
Description

Tests if this user can update Agents. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Agent will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if agent modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAgent
Description

Tests if this user can update a specified agent. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating the agent will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer an update operation to an unauthorized user for this agent.

Parametersosid.id.IdagentIdthe Id of the Agent
Returnboolean false if agent modification is not authorized, true otherwise
ErrorsNULL_ARGUMENT agentId is null
CompliancemandatoryThis method must be implemented.
Provider Notes

If the agentId is not found, then it is acceptable to return false to indicate the lack of an update available.

MethodgetAgentFormForUpdate
Description

Gets the agent form for updating an existing agent. A new agent form should be requested for each update transaction.

Parametersosid.id.IdagentIdthe Id of the Agent
Returnosid.authentication.AgentFormthe agent form
ErrorsNOT_FOUND agentId is not found
NULL_ARGUMENT agentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAgent
Description

Updates an existing agent.

Parametersosid.authentication.AgentFormagentFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE agentForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT agentId or agentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED agentForm did not originate from getAgentFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAgents
Description

Tests if this user can delete Agents. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Agent will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Agent deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAgent
Description

Tests if this user can delete a specified Agent. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the Agent will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer a delete operation to an unauthorized user for this agent.

Parametersosid.id.IdagentIdthe Id of the Agent
Returnboolean false if Agent deletion is not authorized, true otherwise
ErrorsNULL_ARGUMENT agentId is null
CompliancemandatoryThis method must be implemented.
Provider Notes

If the agentId is not found, then it is acceptable to return false to indicate the lack of a delete available.

MethoddeleteAgent
Description

Deletes the Agent identified by the given Id removing it from all other Agencies to which this Agent is associated.

Parametersosid.id.IdagentIdthe Id of the Agent to delete
ErrorsNOT_FOUNDan Agent was not found identified by the given Id
NULL_ARGUMENT agentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAgentAliases
Description

Tests if this user can manage Id aliases for Agents. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Agent aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasAgent
Description

Adds an Id to an Agent for the purpose of creating compatibility. The primary Id of the Agent is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another engine, it is reassigned to the given engine Id.

Parametersosid.id.IdagentIdthe Id of an Agent
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND agentId not found
NULL_ARGUMENT agentId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.