Interface BillingAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
BillingBatchAdminSession

public interface BillingAdminSession extends OsidSession

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 Details

    • canCreateBillings

      boolean canCreateBillings()
      Tests if this user can create Billings . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Billing 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.
      Returns:
      false if Billing creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateBillingWithRecordTypes

      boolean canCreateBillingWithRecordTypes(Type[] billingRecordTypes)
      Tests if this user can create a single Billing using the desired record types. While AcknowledgementManager.getBillingRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Billing . Providing an empty array tests if a Billing can be created with no records.
      Parameters:
      billingRecordTypes - array of types
      Returns:
      true if Billing creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - billingRecordTypes is null
      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 - billingRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - cannot get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createBilling

      Creates a new Billing .
      Parameters:
      billingForm - the form for this Billing
      Returns:
      the new Billing
      Throws:
      IllegalStateException - billingForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - billingForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - billingForm did not originate from getBillingFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateBillings

      boolean canUpdateBillings()
      Tests if this user can update Billings . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Billing 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.
      Returns:
      false if Billing modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getBillingFormForUpdate

      Gets the billing form for updating an existing billing. A new billing form should be requested for each update transaction.
      Parameters:
      billingId - the Id of the Billing
      Returns:
      the billing form
      Throws:
      NotFoundException - billingId is not found
      NullArgumentException - billingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - billingForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - billingForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - billingForm did not originate from getBillingFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteBillings

      boolean canDeleteBillings()
      Tests if this user can delete Billings A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Billing 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.
      Returns:
      false if Billing deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteBilling

      Deletes a Billing .
      Parameters:
      billingId - the Id of the Billing to remove
      Throws:
      NotFoundException - billingId not found
      NullArgumentException - billingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageBillingAliases

      boolean canManageBillingAliases()
      Tests if this user can manage Id aliases for Billings . 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.
      Returns:
      false if Billing aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasBilling

      Adds an Id to a Billing for the purpose of creating compatibility. The primary Id of the Billing is determined by the provider. The new Id is an alias to the primary Id . If the alias is a pointer to another billing, it is reassigned to the given billing Id .
      Parameters:
      billingId - the Id of a Billing
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - billingId not found
      NullArgumentException - billingId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.