Interface ScheduleCalendarAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ScheduleCalendarAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignSchedules

      boolean canAssignSchedules()
      Tests if this user can alter schedule/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 assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignSchedulesToCalendar

      boolean canAssignSchedulesToCalendar(Id calendarId)
      Tests if this user can alter schedule/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 assignment 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 schedule 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.
    • getAssignableCalendarIdsForSchedule

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

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

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

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