Interface FloorAdminSession

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

public interface FloorAdminSession extends OsidSession

This session creates, updates, and deletes Floors . 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 Floor , a FloorForm is requested using getFloorFormForCreate() specifying the desired building and record Types or none if no record Types are needed. The returned FloorForm 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 FloorForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each FloorForm corresponds to an attempted transaction.

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

The delete operations delete Floors . To unmap a Floor from the current Campus , the FloorCampusAssignmentSession should be used. These delete operations attempt to remove the Floor 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.
    • canCreateFloors

      boolean canCreateFloors()
      Tests if this user can create Floors . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Floor 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 Floor creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateFloorWithRecordTypes

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

      FloorForm getFloorFormForCreate(Id buildingId, Type[] floorRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the floor form for creating new floors. A new form should be requested for each create transaction.
      Parameters:
      buildingId - a building Id
      floorRecordTypes - array of floor record types
      Returns:
      the floor form
      Throws:
      NotFoundException - buildingId is not found
      NullArgumentException - buildingId or floorRecordTypes 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.
    • createFloor

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

      boolean canUpdateFloors()
      Tests if this user can update Floors . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Floor 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 Floor modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getFloorFormForUpdate

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

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

      boolean canDeleteFloors()
      Tests if this user can delete Floors A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Floor 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 Floor deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteFloor

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

      boolean canManageFloorAliases()
      Tests if this user can manage Id aliases for Floors . 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 Floor aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasFloor

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