OSID Logo
OSID Specifications
acknowledgement package
Version 3.0.0
Release Candidate Preview
Interfaceosid.acknowledgement.CreditAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Credits. To unmap a Credit from the current Billing, the CreditBillingAssignmentSession should be used. These delete operations attempt to remove the Credit itself thus removing it from all known Billing catalogs.

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

MethodgetBillingId
Description

Gets the Billing Id associated with this session.

Returnosid.id.Idthe Billing Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBilling
Description

Gets the Billing associated with this session.

Returnosid.acknowledgement.Billingthe billing
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateCredits
Description

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

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

Parametersosid.type.Type[]creditRecordTypesarray of credit record types
Returnboolean true if Credit creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT creditRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCreditFormForCreate
Description

Gets the credit form for creating new credits. A new form should be requested for each create transaction.

Parametersosid.id.IdreferenceIdthe reference Id
osid.id.IdresourceIdthe resource Id
osid.type.Type[]creditRecordTypesarray of credit record types to be included in the create operation or an empty list if none
Returnosid.acknowledgement.CreditFormthe credit form
ErrorsNOT_FOUND referenceId or resourceId is not found
NULL_ARGUMENT referenceId, resourceId or creditRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcannot get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCredit
Description

Creates a new Credit.

Parametersosid.acknowledgement.CreditFormcreditFormthe form for this Credit
Returnosid.acknowledgement.Creditthe new Credit
ErrorsILLEGAL_STATE creditForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT creditForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED creditForm did not originate from getCreditFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCredits
Description

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

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

Parametersosid.id.IdcreditIdthe Id of the Credit
Returnosid.acknowledgement.CreditFormthe credit form
ErrorsNOT_FOUND creditId is not found
NULL_ARGUMENT creditId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCredit
Description

Updates an existing credit.

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

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

Deletes a Credit.

Parametersosid.id.IdcreditIdthe Id of the Credit to remove
ErrorsNOT_FOUND creditId not found
NULL_ARGUMENT creditId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCreditAliases
Description

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

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

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