public interface LeaseBatchAdminSession extends LeaseAdminSession
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.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasLeases(AliasRequestList aliasRequests)
Adds an
Id to a Lease for the purpose of
creating compatibility. |
CreateResponseList |
createLeases(LeaseBatchFormList leaseForms)
Creates a new set of
Leases. |
DeleteResponseList |
deleteAllLeases()
Deletes all
Leases in this Campus . |
DeleteResponseList |
deleteIneffectiveLeasesByDate(DateTime date)
Deletes leases expired before the given date.
|
DeleteResponseList |
deleteLeases(IdList leaseIds)
Deletes leases for the given
Ids. |
DeleteResponseList |
deleteLeasesForRoom(Id roomId)
Deletes leases for the given room.
|
DeleteResponseList |
deleteLeasesForTenant(Id resourceId)
Deletes leases for the given tenant.
|
LeaseBatchFormList |
getLeaseFormsForCreate(LeasePeerList peers,
Type[] leaseRecordTypes)
Gets the lease forms for creating a bunch of new leases.
|
LeaseBatchFormList |
getLeaseFormsForUpdate(IdList leaseIds)
Gets the lease forms for updating an existing set of leases.
|
UpdateResponseList |
updateLeases(LeaseBatchFormList leaseForms)
Updates existing leases.
|
aliasLease, canCreateLeases, canCreateLeaseWithRecordTypes, canDeleteLeases, canManageLeaseAliases, canUpdateLeases, createLease, deleteLease, getCampus, getCampusId, getLeaseFormForCreate, getLeaseFormForUpdate, updateLease
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
LeaseBatchFormList getLeaseFormsForCreate(LeasePeerList peers, Type[] leaseRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
peers
- a list of lease peersleaseRecordTypes
- array of lease record types to be included in
each create operation or an empty list if noneNotFoundException
- a roomId
or
resourceId
is not foundNullArgumentException
- peers
or
leaseRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createLeases(LeaseBatchFormList leaseForms) throws OperationFailedException, PermissionDeniedException
Leases.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.leaseForms
- the lease formsNullArgumentException
- leaseForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. LeaseBatchFormList getLeaseFormsForUpdate(IdList leaseIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
leaseIds
- the Ids
of the Lease
NotFoundException
- a leaseId
is not
foundNullArgumentException
- leaseIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateLeases(LeaseBatchFormList leaseForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.leaseForms
- the form containing the elements to be updatedNullArgumentException
- leaseForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllLeases() throws OperationFailedException, PermissionDeniedException
Leases
in this Campus
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteLeases(IdList leaseIds) throws OperationFailedException, PermissionDeniedException
Ids.
leaseIds
- the Ids
of the leases to deleteNullArgumentException
- leaseIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteLeasesForRoom(Id roomId) throws OperationFailedException, PermissionDeniedException
roomId
- the Id
of a roomNullArgumentException
- roomId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteLeasesForTenant(Id resourceId) throws OperationFailedException, PermissionDeniedException
resourceId
- the Id
of a resourceNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveLeasesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasLeases(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a Lease
for the purpose of
creating compatibility. The primary Id
of the
Lease
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is a
pointer to another lease, it is reassigned to the given entry
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.