Interface EventCalendarAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface EventCalendarAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignEvents

      boolean canAssignEvents()
      Tests if this user can alter event/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.
    • canAssignEventsToCalendar

      boolean canAssignEventsToCalendar(Id calendarId)
      Tests if this user can alter event/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 event 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.
    • getAssignableCalendarIdsForEvent

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

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

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

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