Interface PeriodBusinessAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PeriodBusinessAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignPeriods

      boolean canAssignPeriods()
      Tests if this user can alter period/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.
    • canAssignPeriodsToBusiness

      boolean canAssignPeriodsToBusiness(Id businessId)
      Tests if this user can alter period/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 period 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.
    • getAssignableBusinessIdsForPeriod

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

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

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

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