Interface BillingAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
BillingBatchAdminSession
This session creates, updates, and deletes Billings . 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
Billing , a BillingForm is requested using
getBillingFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
BillingForm 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 BillingForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each BillingForm corresponds to an attempted
transaction.
For updates, BillingForms are requested to the Billing
Id that is to be updated using getBillingFormForUpdate() .
Similarly, the BillingForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
BillingForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Billings . It is safer to remove
all mappings to the Billing catalogs before deletion.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasBilling(Id billingId, Id aliasId) Adds anIdto aBillingfor the purpose of creating compatibility.booleanTests if this user can createBillings.booleancanCreateBillingWithRecordTypes(Type[] billingRecordTypes) Tests if this user can create a singleBillingusing the desired record types.booleanTests if this user can deleteBillingsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forBillings.booleanTests if this user can updateBillings.createBilling(BillingForm billingForm) Creates a newBilling.voiddeleteBilling(Id billingId) Deletes aBilling.getBillingFormForCreate(Type[] billingRecordTypes) Gets the billing form for creating new billings.getBillingFormForUpdate(Id billingId) Gets the billing form for updating an existing billing.voidupdateBilling(BillingForm billingForm) Updates an existing billing.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canCreateBillings
boolean canCreateBillings()Tests if this user can createBillings. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aBillingwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifBillingcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateBillingWithRecordTypes
Tests if this user can create a singleBillingusing the desired record types. WhileAcknowledgementManager.getBillingRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBilling. Providing an empty array tests if aBillingcan be created with no records.- Parameters:
billingRecordTypes- array of types- Returns:
trueifBillingcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-billingRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getBillingFormForCreate
BillingForm getBillingFormForCreate(Type[] billingRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the billing form for creating new billings. A new form should be requested for each create transaction.- Parameters:
billingRecordTypes- array of types- Returns:
- the billing form
- Throws:
NullArgumentException-billingRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- cannot get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createBilling
Billing createBilling(BillingForm billingForm) throws OperationFailedException, PermissionDeniedException Creates a newBilling.- Parameters:
billingForm- the form for thisBilling- Returns:
- the new
Billing - Throws:
IllegalStateException-billingFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-billingFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-billingFormdid not originate fromgetBillingFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateBillings
boolean canUpdateBillings()Tests if this user can updateBillings. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aBillingwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifBillingmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getBillingFormForUpdate
BillingForm getBillingFormForUpdate(Id billingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the billing form for updating an existing billing. A new billing form should be requested for each update transaction.- Parameters:
billingId- theIdof theBilling- Returns:
- the billing form
- Throws:
NotFoundException-billingIdis not foundNullArgumentException-billingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBilling
void updateBilling(BillingForm billingForm) throws OperationFailedException, PermissionDeniedException Updates an existing billing.- Parameters:
billingForm- the form containing the elements to be updated- Throws:
IllegalStateException-billingFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-billingFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-billingForm did not originate from getBillingFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteBillings
boolean canDeleteBillings()Tests if this user can deleteBillingsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aBillingwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifBillingdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteBilling
void deleteBilling(Id billingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aBilling.- Parameters:
billingId- theIdof theBillingto remove- Throws:
NotFoundException-billingIdnot foundNullArgumentException-billingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageBillingAliases
boolean canManageBillingAliases()Tests if this user can manageIdaliases forBillings. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifBillingaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasBilling
void aliasBilling(Id billingId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aBillingfor the purpose of creating compatibility. The primaryIdof theBillingis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another billing, it is reassigned to the given billingId.- Parameters:
billingId- theIdof aBillingaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-billingIdnot foundNullArgumentException-billingIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-