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

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

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

The delete operations delete Businesses. It is safer to remove all mappings to the Business catalogs before deletion.

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

MethodcanCreateBusinesses
Description

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

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

Parametersosid.type.Type[]businessRecordTypesarray of business record types
Returnboolean true if Business creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT businessRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetBusinessFormForCreate
Description

Gets the business form for creating new businesses. A new form should be requested for each create transaction.

Parametersosid.type.Type[]businessRecordTypesarray of business record types
Returnosid.billing.BusinessFormthe business form
ErrorsNULL_ARGUMENT businessRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateBusiness
Description

Creates a new Business.

Parametersosid.billing.BusinessFormbusinessFormthe form for this Business
Returnosid.billing.Businessthe new Business
ErrorsILLEGAL_STATE businessForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT businessForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED businessForm did not originate from getBusinessFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateBusinesses
Description

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

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

Parametersosid.id.IdbusinessIdthe Id of the Business
Returnosid.billing.BusinessFormthe business form
ErrorsNOT_FOUND businessId is not found
NULL_ARGUMENT businessId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateBusiness
Description

Updates an existing business.

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

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

Deletes a Business.

Parametersosid.id.IdbusinessIdthe Id of the Business to remove
ErrorsNOT_FOUND businessId not found
NULL_ARGUMENT businessId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageBusinessAliases
Description

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

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

Parametersosid.id.IdbusinessIdthe Id of a Business
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND aliasId is in use as a primary Id
NULL_ARGUMENT businessId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.