Interface RoomAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
RoomBatchAdminSession

public interface RoomAdminSession extends OsidSession

This session creates, updates, and deletes Rooms . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Room , a RoomForm is requested using getRoomFormForCreate() specifying the desired floor and record Types or none if no record Types are needed. The returned RoomForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the RoomForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each RoomForm corresponds to an attempted transaction.

For updates, RoomForms are requested to the Room Id that is to be updated using getRoomFormForUpdate() . Similarly, the RoomForm has metadata about the data that can be updated and it can perform validation before submitting the update. The RoomForm can only be used once for a successful update and cannot be reused.

The delete operations delete Rooms . To unmap a Room from the current Campus , the RoomCampusAssignmentSession should be used. These delete operations attempt to remove the Room itself thus removing it from all known Campus catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getCampusId

      Id getCampusId()
      Gets the Campus Id associated with this session.
      Returns:
      the Campus Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCampus

      Gets the Campus associated with this session.
      Returns:
      the campus
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRooms

      boolean canCreateRooms()
      Tests if this user can create hournal entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Room will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Room creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRoomWithRecordTypes

      boolean canCreateRoomWithRecordTypes(Type[] roomRecordTypes)
      Tests if this user can create a single Room using the desired record interface types. While RoomManager.getRoomRecordTypes() can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specific Room . Providing an empty array tests if a Room can be created with no records.
      Parameters:
      roomRecordTypes - array of room record types
      Returns:
      true if Room creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - roomRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getRoomFormForCreate

      RoomForm getRoomFormForCreate(Id floorId, Type[] roomRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the room form for creating new entries. A new form should be requested for each create transaction.
      Parameters:
      floorId - the Id for the floor
      roomRecordTypes - array of room record types
      Returns:
      the room form
      Throws:
      NotFoundException - floorId is not found
      NullArgumentException - floorId or roomRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get from for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createRoom

      Creates a new Room .
      Parameters:
      roomForm - the form for this Room
      Returns:
      the new Room
      Throws:
      IllegalStateException - roomForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - roomForm did not originate from getRoomFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateRooms

      boolean canUpdateRooms()
      Tests if this user can update rooms. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Room will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Room modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getRoomFormForUpdate

      Gets the room form for updating an existing room. A new room form should be requested for each update transaction.
      Parameters:
      roomId - the Id of the Room
      Returns:
      the room form
      Throws:
      NotFoundException - roomId is not found
      NullArgumentException - roomId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateRoom

      void updateRoom(RoomForm roomForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing room.
      Parameters:
      roomForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - roomForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - roomForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - roomForm did not originate from getRoomFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteRooms

      boolean canDeleteRooms()
      Tests if this user can delete rooms. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Room will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Room deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteRoom

      Deletes an Room .
      Parameters:
      roomId - the Id of the Room to remove
      Throws:
      NotFoundException - roomId not found
      NullArgumentException - roomId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageRoomAliases

      boolean canManageRoomAliases()
      Tests if this user can manage Id aliases for Comnents . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Room aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasRoom

      Adds an Id to a Room for the purpose of creating compatibility. The primary Id of the Room is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another room, it is reassigned to the given room Id .
      Parameters:
      roomId - the Id of a Room
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - roomId not found
      NullArgumentException - roomId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.