OSID Logo
OSID Specifications
financials package
Version 3.0.0
Release Candidate Preview
Interfaceosid.financials.AccountAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Accounts. To unmap an Account from the current Business, the AccountBusinessAssignmentSession should be used. These delete operations attempt to remove the Account itself thus removing it from all known Business catalogs.

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

MethodgetBusinessId
Description

Gets the Business Id associated with this session.

Returnosid.id.Idthe Business Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBusiness
Description

Gets the Business associated with this session.

Returnosid.financials.Businessthe business
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateAccounts
Description

Tests if this user can create Accounts. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Account 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 Account creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateAccountWithRecordTypes
Description

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

Parametersosid.type.Type[]accountRecordTypesarray of account record types
Returnboolean true if Account creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT accountRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAccountFormForCreate
Description

Gets the account form for creating new accounts. A new form should be requested for each create transaction.

Parametersosid.type.Type[]accountRecordTypesarray of account record types
Returnosid.financials.AccountFormthe account form
ErrorsNULL_ARGUMENT accountRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAccount
Description

Creates a new Account.

Parametersosid.financials.AccountFormaccountFormthe form for this Account
Returnosid.financials.Accountthe new Account
ErrorsILLEGAL_STATE accountForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT accountForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED accountForm did not originate from getAccountFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAccounts
Description

Tests if this user can update Accounts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Account 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 Account modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetAccountFormForUpdate
Description

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

Parametersosid.id.IdaccountIdthe Id of the Account
Returnosid.financials.AccountFormthe account form
ErrorsNOT_FOUND accountId is not found
NULL_ARGUMENT accountId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAccount
Description

Updates an existing account.

Parametersosid.financials.AccountFormaccountFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE accountForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT accountForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED accountForm did not originate from getAccountFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAccounts
Description

Tests if this user can delete Accounts. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Account 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 Account deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteAccount
Description

Deletes an Account.

Parametersosid.id.IdaccountIdthe Id of the Account to remove
ErrorsNOT_FOUND accountId not found
NULL_ARGUMENT accountId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAccountAliases
Description

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

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

Parametersosid.id.IdaccountIdthe Id of an Account
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND accountId not found
NULL_ARGUMENT accountId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.