Interface TimePeriodCalendarAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface TimePeriodCalendarAssignmentSession extends OsidSession

This session provides methods to re-assign TimePeriods to Calendars . A TimePeriod may map to multiple Calendars and removing the last reference to a TimePeriod is the equivalent of deleting it. Each Calendar may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a TimePeriod to another Calendar is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignTimePeriods

      boolean canAssignTimePeriods()
      Tests if this user can alter time period/calendar 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.
    • canAssignTimePeriodsToCalendar

      boolean canAssignTimePeriodsToCalendar(Id calendarId)
      Tests if this user can alter time period/calendar 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:
      calendarId - the Id of the Calendar
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - calendarId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCalendarIds

      IdList getAssignableCalendarIds(Id calendarId) throws OperationFailedException
      Gets a list of calendars including and under the given calendar node in which any time period can be assigned.
      Parameters:
      calendarId - the Id of the Calendar
      Returns:
      list of assignable calendar Ids
      Throws:
      NullArgumentException - calendarId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCalendarIdsForTimePeriod

      IdList getAssignableCalendarIdsForTimePeriod(Id calendarId, Id timePeriodId) throws OperationFailedException
      Gets a list of calendars including and under the given calendar node in which a specific time period can be assigned.
      Parameters:
      calendarId - the Id of the Calendar
      timePeriodId - the Id of the TimePeriod
      Returns:
      list of assignable calendar Ids
      Throws:
      NullArgumentException - calendarId or timePeriodId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignTimePeriodToCalendar

      void assignTimePeriodToCalendar(Id timePeriodId, Id calendarId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing TimePeriod to a Calendar .
      Parameters:
      timePeriodId - the Id of the TimePeriod
      calendarId - the Id of the Calendar
      Throws:
      AlreadyExistsException - timePeriodId is already assigned to calendarId
      NotFoundException - timePeriodId or calendarId not found
      NullArgumentException - timePeriodId or calendarId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignTimePeriodFromCalendar

      void unassignTimePeriodFromCalendar(Id timePeriodId, Id calendarId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a TimePeriod from a Calendar .
      Parameters:
      timePeriodId - the Id of the TimePeriod
      calendarId - the Id of the Calendar
      Throws:
      NotFoundException - timePeriodId or calendarId not found or timePeriodId not assigned to calendarId
      NullArgumentException - timePeriodId or calendarId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignTimePeriodToCalendar

      void reassignTimePeriodToCalendar(Id timePeriodId, Id fromCalendarId, Id toCalendarId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a TimePeriod from one Calendar to another. Mappings to other Calendars are unaffected.
      Parameters:
      timePeriodId - the Id of the TimePeriod
      fromCalendarId - the Id of the current Calendar
      toCalendarId - the Id of the destination Calendar
      Throws:
      AlreadyExistsException - timePeriodId already assigned to toCalendarId
      NotFoundException - timePeriodId, fromCalendarId , or toCalendarId not found or timePeriodId not mapped to fromCalendarId
      NullArgumentException - timePeriodId, fromCalendarId , or toCalendarId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.