Interface CreditBillingAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CreditBillingAssignmentSession extends OsidSession

This session provides methods to re-assign Credits to Bilings . A Credit may map to multiple Billings and removing the last reference to a Credit is the equivalent of deleting it. Each Billing may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Credit to another Billing is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignCredits

      boolean canAssignCredits()
      Tests if this user can alter credit/billing mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignCreditsToBilling

      boolean canAssignCreditsToBilling(Id billingId)
      Tests if this user can alter credit/billing mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      billingId - the Id of the Billing
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - billingId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBillingIds

      IdList getAssignableBillingIds(Id billingId) throws OperationFailedException
      Gets a list of billings including and under the given billing node in which any credit can be assigned.
      Parameters:
      billingId - the Id of the Billing
      Returns:
      list of assignable billing Ids
      Throws:
      NullArgumentException - billingId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBillingIdsForCredit

      IdList getAssignableBillingIdsForCredit(Id billingId, Id creditId) throws OperationFailedException
      Gets a list of billings including and under the given billing node in which a specific credit can be assigned.
      Parameters:
      billingId - the Id of the Billing
      creditId - the Id of the Credit
      Returns:
      list of assignable billing Ids
      Throws:
      NullArgumentException - billingId or creditId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignCreditToBilling

      void assignCreditToBilling(Id creditId, Id billingId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Credit to a Billing .
      Parameters:
      creditId - the Id of the Credit
      billingId - the Id of the Billing
      Throws:
      AlreadyExistsException - creditId already assigned to billingId
      NotFoundException - creditId or billingId not found
      NullArgumentException - creditId or billingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignCreditFromBilling

      void unassignCreditFromBilling(Id creditId, Id billingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Credit from a Billing .
      Parameters:
      creditId - the Id of the Credit
      billingId - the Id of the Billing
      Throws:
      NotFoundException - creditId or billingId not found or creditId not mapped to billingId
      NullArgumentException - creditId or billingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignCreditToBilling

      void reassignCreditToBilling(Id creditId, Id fromBillingId, Id toBiillingId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Credit from one Billing to another. Mappings to other Billings are unaffected.
      Parameters:
      creditId - the Id of the Credit
      fromBillingId - the Id of the current Billing
      toBiillingId - the Id of the destination Billing
      Throws:
      AlreadyExistsException - creditId already assigned to toBillingId
      NotFoundException - creditId, fromBillingId , or toBillingId not found or creditId not mapped to fromBillingId
      NullArgumentException - creditId, fromBillingId , or toBillingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.