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
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
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasRoom(Id roomId,
Id aliasId)
Adds an
Id to a Room for the purpose of
creating compatibility. |
boolean |
canCreateRooms()
Tests if this user can create hournal entries.
|
boolean |
canCreateRoomWithRecordTypes(Type[] roomRecordTypes)
Tests if this user can create a single
Room using the
desired record interface types. |
boolean |
canDeleteRooms()
Tests if this user can delete rooms.
|
boolean |
canManageRoomAliases()
Tests if this user can manage
Id aliases for
Comnents. |
boolean |
canUpdateRooms()
Tests if this user can update rooms.
|
Room |
createRoom(RoomForm roomForm)
Creates a new
Room. |
void |
deleteRoom(Id roomId)
Deletes an
Room. |
Campus |
getCampus()
Gets the
Campus associated with this session. |
Id |
getCampusId()
Gets the
Campus Id associated with this
session. |
RoomForm |
getRoomFormForCreate(Id floorId,
Type[] roomRecordTypes)
Gets the room form for creating new entries.
|
RoomForm |
getRoomFormForUpdate(Id roomId)
Gets the room form for updating an existing room.
|
void |
updateRoom(RoomForm roomForm)
Updates an existing room.
|
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 canCreateRooms()
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. false
if Room
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateRoomWithRecordTypes(Type[] roomRecordTypes)
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.roomRecordTypes
- array of room record types true
if Room
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- roomRecordTypes
is null
mandatory
- This method must be implemented. RoomForm getRoomFormForCreate(Id floorId, Type[] roomRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
floorId
- the Id
for the floorroomRecordTypes
- array of room record typesNotFoundException
- floorId
is not foundNullArgumentException
- floorId
or
roomRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get from for requested
record typesmandatory
- This method must be implemented. Room createRoom(RoomForm roomForm) throws OperationFailedException, PermissionDeniedException
Room.
roomForm
- the form for this Room
Room
IllegalStateException
- roomForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- roomForm
did not
originate from getRoomFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateRooms()
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. false
if Room
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. RoomForm getRoomFormForUpdate(Id roomId) throws NotFoundException, OperationFailedException, PermissionDeniedException
roomId
- the Id
of the Room
NotFoundException
- roomId
is not foundNullArgumentException
- roomId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateRoom(RoomForm roomForm) throws OperationFailedException, PermissionDeniedException
roomForm
- the form containing the elements to be updatedIllegalStateException
- roomForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- roomForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- roomForm
did not
originate from getRoomFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteRooms()
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. false
if Room
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteRoom(Id roomId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Room.
roomId
- the Id
of the Room
to
removeNotFoundException
- roomId
not foundNullArgumentException
- roomId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageRoomAliases()
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. false
if Room
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasRoom(Id roomId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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.
roomId
- the Id
of a Room
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- roomId
not foundNullArgumentException
- roomId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.