Interface RoomBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, RoomAdminSession
This session creates, updates, and deletes Rooms in bulk. 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
getRoomFormsForCreate() specifying the desired floor and record
Types or none if no record Types are needed. Each of the returned
RoomForms 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 a 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.
The RoomForms returned from getRoomFormsForCreate()
may be linked to the originating request through the peer Ids of
the RoomForm . In the case where there may be duplicates, any
RoomForm of the same peer Ids may be used for a create
operation.
Once a batch of RoomForms are submitted for create, a
CreateResponse is returned for each RoomForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createRooms() , errors specific to an
individual RoomForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
RoomForm through the RoomForm Id .
For updates, RoomForms are requested to the Room
Id that is to be updated using getRoomFormsForUpdate()
where the reference Id in the RoomForm may be used to link
the request. 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.
Once a batch of RoomForms are submitted for update, an
UpdateResponse is returned for each RoomForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateRooms() , errors specific to an
individual RoomForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
RoomForm through the RoomForm Id .
The delete operations delete Rooms in bulk. 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. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasRooms(AliasRequestList aliasRequests) Adds anIdto aRoomfor the purpose of creating compatibility.createRooms(RoomBatchFormList roomForms) Creates a new set ofRooms.Deletes allRoomsin thisCampus.Deletes rooms expired before the given date.deleteRooms(IdList roomIds) Deletes rooms for the givenIds.deleteRoomsForFloor(Id roomId) Deletes rooms on the given floor.getRoomFormsForCreate(IdList floorIds, Type[] roomRecordTypes) Gets the room forms for creating a bunch of new rooms.getRoomFormsForUpdate(IdList roomIds) Gets the room forms for updating an existing set of rooms.updateRooms(RoomBatchFormList roomForms) Updates existing rooms.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.Methods inherited from interface RoomAdminSession
aliasRoom, canCreateRooms, canCreateRoomWithRecordTypes, canDeleteRooms, canManageRoomAliases, canUpdateRooms, createRoom, deleteRoom, getCampus, getCampusId, getRoomFormForCreate, getRoomFormForUpdate, updateRoomModifier and TypeMethodDescriptionvoidAdds anIdto aRoomfor the purpose of creating compatibility.booleanTests if this user can create hournal entries.booleancanCreateRoomWithRecordTypes(Type[] roomRecordTypes) Tests if this user can create a singleRoomusing the desired record interface types.booleanTests if this user can delete rooms.booleanTests if this user can manageIdaliases forComnents.booleanTests if this user can update rooms.createRoom(RoomForm roomForm) Creates a newRoom.voiddeleteRoom(Id roomId) Deletes anRoom.Gets theCampusassociated with this session.Gets theCampusIdassociated with this session.getRoomFormForCreate(Id floorId, Type[] roomRecordTypes) Gets the room form for creating new entries.getRoomFormForUpdate(Id roomId) Gets the room form for updating an existing room.voidupdateRoom(RoomForm roomForm) Updates an existing room.
-
Method Details
-
getRoomFormsForCreate
RoomBatchFormList getRoomFormsForCreate(IdList floorIds, Type[] roomRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the room forms for creating a bunch of new rooms. A form is returned for each supplied floor.- Parameters:
floorIds- a list of floorIdsroomRecordTypes- array of room record types to be included in each create operation or an empty list if none- Returns:
- the room forms
- Throws:
NotFoundException- afloorIdis not foundNullArgumentException-floorIdsorroomRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createRooms
CreateResponseList createRooms(RoomBatchFormList roomForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofRooms. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
roomForms- the room forms- Returns:
- the create responses
- Throws:
NullArgumentException-roomFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRoomFormsForUpdate
RoomBatchFormList getRoomFormsForUpdate(IdList roomIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the room forms for updating an existing set of rooms. A new room form should be requested for each update transaction.- Parameters:
roomIds- theIdsof theRoom- Returns:
- the room form
- Throws:
NotFoundException- aroomIdis not foundNullArgumentException-roomIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRooms
UpdateResponseList updateRooms(RoomBatchFormList roomForms) throws OperationFailedException, PermissionDeniedException Updates existing rooms. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
roomForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-roomFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllRooms
Deletes allRoomsin thisCampus.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRooms
DeleteResponseList deleteRooms(IdList roomIds) throws OperationFailedException, PermissionDeniedException Deletes rooms for the givenIds.- Parameters:
roomIds- theIdsof the rooms to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-roomIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRoomsForFloor
DeleteResponseList deleteRoomsForFloor(Id roomId) throws OperationFailedException, PermissionDeniedException Deletes rooms on the given floor.- Parameters:
roomId- theIdof a floor- Returns:
- the delete responses
- Throws:
NullArgumentException-floorIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveRoomsByDate
DeleteResponseList deleteIneffectiveRoomsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes rooms expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasRooms
AliasResponseList aliasRooms(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aRoomfor the purpose of creating compatibility. The primaryIdof theRoomis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another room, it is reassigned to the given entryId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-