Interface PaymentBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PaymentBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Payments to Businesses . A Payment may appear in multiple Businesses and removing the last reference to a Payment is the equivalent of deleting it. Each Business may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignPayments

      boolean canAssignPayments()
      Tests if this user can alter payment/business 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.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignPaymentToBusiness

      boolean canAssignPaymentToBusiness(Id businessId)
      Tests if this user can alter payment/business 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.
      Parameters:
      businessId - the Id of the Business
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - businessId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIds

      IdList getAssignableBusinessIds(Id businessId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which any payment can be assigned.
      Parameters:
      businessId - the Id of the Business
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableBusinessIdsForPayment

      IdList getAssignableBusinessIdsForPayment(Id businessId, Id paymentId) throws OperationFailedException
      Gets a list of businesses including and under the given business node in which a specific payment can be assigned.
      Parameters:
      businessId - the Id of the Business
      paymentId - the Id of the Payment
      Returns:
      list of assignable business Ids
      Throws:
      NullArgumentException - businessId or paymentId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignPaymentToBusiness

      void assignPaymentToBusiness(Id paymentId, Id businessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Payment to a Business .
      Parameters:
      paymentId - the Id of the Payment
      businessId - the Id of the Business
      Throws:
      AlreadyExistsException - paymentId is already assigned to businessId
      NotFoundException - paymentId or businessId not found
      NullArgumentException - paymentId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignPaymentFromBusiness

      void unassignPaymentFromBusiness(Id paymentId, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Payment from a Business .
      Parameters:
      paymentId - the Id of the Payment
      businessId - the Id of the Business
      Throws:
      NotFoundException - paymentId or businessId not found or paymentId not assigned to businessId
      NullArgumentException - paymentId or businessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignPaymentToBusiness

      void reassignPaymentToBusiness(Id paymentId, Id fromBusinessId, Id toBusinessId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Payment from one Business to another. Mappings to other Businesses are unaffected.
      Parameters:
      paymentId - the Id of the Payment
      fromBusinessId - the Id of the current Business
      toBusinessId - the Id of the destination Business
      Throws:
      AlreadyExistsException - paymentId already assigned to toBusinessId
      NotFoundException - paymentId, fromBusinessId , or toBusinessId not found or paymentId not mapped to fromBusinessId
      NullArgumentException - paymentId, fromBusinessId , or toBusinessId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.