OSID Logo
OSID Specifications
billing package
Version 3.0.0
Release Candidate Preview
Interfaceosid.billing.PeriodAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Periods. To unmap a Period from the current Business, the PeriodBusinessAssignmentSession should be used. These delete operations attempt to remove the Period 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.billing.Businessthe business
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreatePeriods
Description

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

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

Parametersosid.type.Type[]periodRecordTypesarray of period record types
Returnboolean true if Period creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT periodRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetPeriodFormForCreate
Description

Gets the period form for creating new periods. A new form should be requested for each create transaction.

Parametersosid.type.Type[]periodRecordTypesarray of period record types
Returnosid.billing.PeriodFormthe period form
ErrorsNULL_ARGUMENT periodRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreatePeriod
Description

Creates a new Period.

Parametersosid.billing.PeriodFormperiodFormthe form for this Period
Returnosid.billing.Periodthe new Period
ErrorsILLEGAL_STATE periodForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT periodForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED periodForm did not originate from getPeriodFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdatePeriods
Description

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

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

Parametersosid.id.IdperiodIdthe Id of the Period
Returnosid.billing.PeriodFormthe period form
ErrorsNOT_FOUND periodId is not found
NULL_ARGUMENT periodId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdatePeriod
Description

Updates an existing period.

Parametersosid.billing.PeriodFormperiodFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE periodForm already used in anjupdate transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT periodId or periodForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED periodForm did not originate from getPeriodFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeletePeriods
Description

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

Deletes a Period.

Parametersosid.id.IdperiodIdthe Id of the Period to remove
ErrorsNOT_FOUND periodId not found
NULL_ARGUMENT periodId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManagePeriodAliases
Description

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

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

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