Interface CyclicTimePeriodCalendarAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CyclicTimePeriodCalendarAssignmentSession extends OsidSession

This session provides methods to re-assign CyclicTimePeriods to Calendars . A CyclicTimePeriod may map to multiple Calendars and removing the last reference to a CyclicTimePeriod 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 CyclicTimePeriod to another Calendar is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignCyclicTimePeriods

      boolean canAssignCyclicTimePeriods()
      Tests if this user can alter cyclic 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.
    • canAssignCyclicTimePeriodsToCalendar

      boolean canAssignCyclicTimePeriodsToCalendar(Id calendarId)
      Tests if this user can alter cyclic 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 cyclic 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.
    • getAssignableCalendarIdsForCyclicTimePeriod

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

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

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

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