Interface RoomCampusAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RoomCampusAssignmentSession extends OsidSession

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

Adding a reference of a Room to another Campus is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignRooms

      boolean canAssignRooms()
      Tests if this user can alter room/campus 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.
    • canAssignRoomsToCampus

      boolean canAssignRoomsToCampus(Id campusId)
      Tests if this user can alter room/campus 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:
      campusId - the Id of the Campus
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - campusId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCampusIds

      IdList getAssignableCampusIds(Id campusId) throws OperationFailedException
      Gets a list of campuses including and under the given campus node in which any room can be assigned.
      Parameters:
      campusId - the Id of the Campus
      Returns:
      list of assignable campus Ids
      Throws:
      NullArgumentException - campusId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCampusIdsForRoom

      IdList getAssignableCampusIdsForRoom(Id campusId, Id roomId) throws OperationFailedException
      Gets a list of campuses including and under the given campus node in which a specific room can be assigned.
      Parameters:
      campusId - the Id of the Campus
      roomId - the Id of the Room
      Returns:
      list of assignable campus Ids
      Throws:
      NullArgumentException - campusId or roomId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignRoomToCampus

      Adds an existing Room to a Campus .
      Parameters:
      roomId - the Id of the Room
      campusId - the Id of the Campus
      Throws:
      AlreadyExistsException - roomId is already assigned to campusId
      NotFoundException - roomId or campusId not found
      NullArgumentException - roomId or campusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignRoomFromCampus

      void unassignRoomFromCampus(Id roomId, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Room from a Campus .
      Parameters:
      roomId - the Id of the Room
      campusId - the Id of the Campus
      Throws:
      NotFoundException - roomId or campusId not found or roomId not assigned to campusId
      NullArgumentException - roomId or campusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignRoomToCampus

      void reassignRoomToCampus(Id roomId, Id fromCampusId, Id toCampusId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Room from one Campus to another. Mappings to other Campuses are unaffected.
      Parameters:
      roomId - the Id of the Room
      fromCampusId - the Id of the current Campus
      toCampusId - the Id of the destination Campus
      Throws:
      AlreadyExistsException - roomId , already assigned to toCampusId
      NotFoundException - roomId, fromCampusId , or toCampusId not found or roomId not mapped to fromCampusId
      NullArgumentException - roomId, fromCampusId , or toCampusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.