Interface CommitmentCalendarAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CommitmentCalendarAssignmentSession extends OsidSession

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

  • Method Details

    • canAssignCommitments

      boolean canAssignCommitments()
      Tests if this user can alter commitment/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.
    • canAssignCommitmentsToCalendar

      boolean canAssignCommitmentsToCalendar(Id calendarId)
      Tests if this user can alter commitment/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 commitment 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.
    • getAssignableCalendarIdsForCommitment

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

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

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

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