Interface BudgetEntryBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface BudgetEntryBusinessAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignBudgetEntries

      boolean canAssignBudgetEntries()
      Tests if this user can alter entry/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.
    • canAssignBudgetEntriesToBusiness

      boolean canAssignBudgetEntriesToBusiness(Id businessId)
      Tests if this user can alter entry/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 entry 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.
    • getAssignableBusinessIdsForBudgetEntry

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

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

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

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