Interface BudgetBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface BudgetBusinessAssignmentSession extends OsidSession

This session provides methods to re-assign Budgets to Businesses . A Budget may appear in multiple Businesses and removing the last reference to a Budget 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 Budget to another Business is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignBudgets

      boolean canAssignBudgets()
      Tests if this user can alter budget/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.
    • canAssignBudgetToBusiness

      boolean canAssignBudgetToBusiness(Id businessId)
      Tests if this user can alter budget/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 budget 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.
    • getAssignableBusinessIdsForBudget

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

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

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

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