Interface LeaseBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, LeaseAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Leases 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
Lease , a LeaseForm is requested using
getLeaseFormsForCreate() specifying the desired peers and record
Types or none if no record Types are needed. Each of the returned
LeaseForms 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 LeaseForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each LeaseForm corresponds to an attempted
transaction.
The LeaseForms returned from getLeaseFormsForCreate()
may be linked to the originating request through the peer Ids of
the LeaseForm . In the case where there may be duplicates, any
LeaseForm of the same peer Ids may be used for a create
operation.
Once a batch of LeaseForms are submitted for create, a
CreateResponse is returned for each LeaseForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createLeases() , errors specific to an
individual LeaseForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
LeaseForm through the LeaseForm Id .
For updates, LeaseForms are requested to the Lease
Id that is to be updated using getLeaseFormsForUpdate()
where the reference Id in the LeaseForm may be used to
link the request. Similarly, the LeaseForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The LeaseForm can only be used once for a successful
update and cannot be reused.
Once a batch of LeaseForms are submitted for update, an
UpdateResponse is returned for each LeaseForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateLeases() , errors specific to an
individual LeaseForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
LeaseForm through the LeaseForm Id .
The delete operations delete Leases in bulk. To unmap a
Lease from the current Campus , the
LeaseCampusAssignmentSession should be used. These delete operations
attempt to remove the Lease itself thus removing it from all known
Campus catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasLeases(AliasRequestList aliasRequests) Adds anIdto aLeasefor the purpose of creating compatibility.createLeases(LeaseBatchFormList leaseForms) Creates a new set ofLeases.Deletes allLeasesin thisCampus.Deletes leases expired before the given date.deleteLeases(IdList leaseIds) Deletes leases for the givenIds.deleteLeasesForRoom(Id roomId) Deletes leases for the given room.deleteLeasesForTenant(Id resourceId) Deletes leases for the given tenant.getLeaseFormsForCreate(LeasePeerList peers, Type[] leaseRecordTypes) Gets the lease forms for creating a bunch of new leases.getLeaseFormsForUpdate(IdList leaseIds) Gets the lease forms for updating an existing set of leases.updateLeases(LeaseBatchFormList leaseForms) Updates existing leases.Methods inherited from interface LeaseAdminSession
aliasLease, canCreateLeases, canCreateLeaseWithRecordTypes, canDeleteLeases, canManageLeaseAliases, canUpdateLeases, createLease, deleteLease, getCampus, getCampusId, getLeaseFormForCreate, getLeaseFormForUpdate, updateLeaseModifier and TypeMethodDescriptionvoidaliasLease(Id leaseId, Id aliasId) Adds anIdto aLeasefor the purpose of creating compatibility.booleanTests if this user can createLeases.booleancanCreateLeaseWithRecordTypes(Type[] leaseRecordTypes) Tests if this user can create a singleLeaseusing the desired record interface types.booleanTests if this user can deleteLeasesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forLeases.booleanTests if this user can updateLeases.createLease(LeaseForm leaseForm) Creates a newLease.voiddeleteLease(Id leaseId) Deletes aLease.Gets theCampusassociated with this session.Gets theCampusIdassociated with this session.getLeaseFormForCreate(Id roomId, Id resourceId, Type[] leaseRecordTypes) Gets the lease form for creating new leases.getLeaseFormForUpdate(Id leaseId) Gets the lease form for updating an existing lease.voidupdateLease(LeaseForm leaseForm) Updates an existing lease.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.
-
Method Details
-
getLeaseFormsForCreate
LeaseBatchFormList getLeaseFormsForCreate(LeasePeerList peers, Type[] leaseRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the lease forms for creating a bunch of new leases. A lease form is returned for each supplied peer.- Parameters:
peers- a list of lease peersleaseRecordTypes- array of lease record types to be included in each create operation or an empty list if none- Returns:
- the lease forms
- Throws:
NotFoundException- aroomIdorresourceIdis not foundNullArgumentException-peersorleaseRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createLeases
CreateResponseList createLeases(LeaseBatchFormList leaseForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofLeases. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
leaseForms- the lease forms- Returns:
- the create responses
- Throws:
NullArgumentException-leaseFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getLeaseFormsForUpdate
LeaseBatchFormList getLeaseFormsForUpdate(IdList leaseIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the lease forms for updating an existing set of leases. A new lease form should be requested for each update transaction.- Parameters:
leaseIds- theIdsof theLease- Returns:
- the lease form
- Throws:
NotFoundException- aleaseIdis not foundNullArgumentException-leaseIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateLeases
UpdateResponseList updateLeases(LeaseBatchFormList leaseForms) throws OperationFailedException, PermissionDeniedException Updates existing leases. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
leaseForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-leaseFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllLeases
Deletes allLeasesin thisCampus.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteLeases
DeleteResponseList deleteLeases(IdList leaseIds) throws OperationFailedException, PermissionDeniedException Deletes leases for the givenIds.- Parameters:
leaseIds- theIdsof the leases to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-leaseIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteLeasesForRoom
DeleteResponseList deleteLeasesForRoom(Id roomId) throws OperationFailedException, PermissionDeniedException Deletes leases for the given room.- Parameters:
roomId- theIdof a room- Returns:
- the delete responses
- Throws:
NullArgumentException-roomIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteLeasesForTenant
DeleteResponseList deleteLeasesForTenant(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes leases for the given tenant.- Parameters:
resourceId- theIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveLeasesByDate
DeleteResponseList deleteIneffectiveLeasesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes leases 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.
-
aliasLeases
AliasResponseList aliasLeases(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aLeasefor the purpose of creating compatibility. The primaryIdof theLeaseis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another lease, 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.
-