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

This session creates, updates, and deletes Agencies. 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 Agency, an AgencyForm is requested using getAgencyFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned AgencyForm 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 AgencyForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each AgencyForm corresponds to an attempted transaction.

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

The delete operations delete Agencies.

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

MethodcanCreateAgencies
Description

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

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

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

Parametersosid.type.Type[]agencyRecordTypesarray of agency record types
Returnboolean true if Agency creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT agencyRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAgencyFormForCreate
Description

Gets the agency form for creating new agencies. A new form should be requested for each create transaction.

Parametersosid.type.Type[]agencyRecordTypesarray of agency record types
Returnosid.authentication.AgencyFormthe agency form
ErrorsNULL_ARGUMENT agencyRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAgency
Description

Creates a new Agency.

Parametersosid.authentication.AgencyFormagencyFormthe form for this Agency
Returnosid.authentication.Agencythe new Agency
ErrorsILLEGAL_STATE agencyForm already used for a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT agencyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED agencyForm did not originate from getAgencyFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAgencies
Description

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

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

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

Parametersosid.id.IdagencyIdthe Id of the Agency
Returnosid.authentication.AgencyFormthe agency form
ErrorsNOT_FOUND agencyId is not found
NULL_ARGUMENT agencyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAgency
Description

Updates an existing agency.

Parametersosid.authentication.AgencyFormagencyFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE agencyForm already used for an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT agencyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED agencyForm did not originate from getAgencyFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAgencies
Description

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

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

Deletes an Agency.

Parametersosid.id.IdagencyIdthe Id of the Agency to remove
ErrorsNOT_FOUND agencyId not found
NULL_ARGUMENT agencyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAgencyAliases
Description

Tests if this user can manage Id aliases for Agencies. 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 Agency aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasAgency
Description

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

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