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
object. 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.
Modifier and Type | Method and Description |
---|---|
void |
aliasFloor(Id floorId,
Id aliasId)
Adds an
Id to a Floor for the purpose of
creating compatibility. |
boolean |
canCreateFloors()
Tests if this user can create
Floors. |
boolean |
canCreateFloorWithRecordTypes(Type[] floorRecordTypes)
Tests if this user can create a single
Floor using the
desired record interface types. |
boolean |
canDeleteFloors()
Tests if this user can delete
Floors A return of true
does not guarantee successful authorization. |
boolean |
canManageFloorAliases()
Tests if this user can manage
Id aliases for
Floors. |
boolean |
canUpdateFloors()
Tests if this user can update
Floors. |
Floor |
createFloor(FloorForm floorForm)
Creates a new
Floor. |
void |
deleteFloor(Id floorId)
Deletes a
Floor. |
Campus |
getCampus()
Gets the
Campus associated with this session. |
Id |
getCampusId()
Gets the
Campus Id associated with this
session. |
FloorForm |
getFloorFormForCreate(Id buildingId,
Type[] floorRecordTypes)
Gets the floor form for creating new floors.
|
FloorForm |
getFloorFormForUpdate(Id floorId)
Gets the floor form for updating an existing floor.
|
void |
updateFloor(FloorForm floorForm)
Updates an existing floor.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCampusId()
Campus
Id
associated with this
session. Campus Id
associated with this sessionmandatory
- This method must be implemented. Campus getCampus() throws OperationFailedException, PermissionDeniedException
Campus
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateFloors()
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. false
if Floor
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateFloorWithRecordTypes(Type[] floorRecordTypes)
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.floorRecordTypes
- array of floor record types true
if Floor
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- floorRecordTypes
is null
mandatory
- This method must be implemented. FloorForm getFloorFormForCreate(Id buildingId, Type[] floorRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
buildingId
- a building Id
floorRecordTypes
- array of floor record typesNotFoundException
- buildingId
is not
foundNullArgumentException
- buildingId
or
floorRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get from for requested
record typesmandatory
- This method must be implemented. Floor createFloor(FloorForm floorForm) throws OperationFailedException, PermissionDeniedException
Floor.
floorForm
- the form for this Floor
Floor
IllegalStateException
- floorForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- floorForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- floorForm
did not
originate from getFloorFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateFloors()
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. false
if Floor
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. FloorForm getFloorFormForUpdate(Id floorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
floorId
- the Id
of the Floor
NotFoundException
- floorId
is not foundNullArgumentException
- floorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateFloor(FloorForm floorForm) throws OperationFailedException, PermissionDeniedException
floorForm
- the form containing the elements to be updatedIllegalStateException
- floorForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- floorForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- floorForm
did not
originate from getFloorFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteFloors()
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. false
if Floor
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteFloor(Id floorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Floor.
floorId
- the Id
of the Floor
to
removeNotFoundException
- floorId
not foundNullArgumentException
- floorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageFloorAliases()
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. false
if Floor
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasFloor(Id floorId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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.
floorId
- the Id
of a Floor
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- floorId
not foundNullArgumentException
- floorId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.