public interface BinBatchAdminSession extends BinAdminSession
This session creates, updates, and deletes Bins
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 an
Bin,
an BinForm
is requested using
getBinFormsForCreate()
specifying the desired record Types
or none if no record Types
are needed. Each of the
returned BinForms
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 an BinForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each BinForm
corresponds
to an attempted transaction.
The BinForms
returned from
getBinFormsForCreate()
may be linked to the originating request
through the peer Ids
of the BinForm.
In the
case where there may be duplicates, any BinForm
of the same
peer Ids
may be used for a create operation.
Once a batch of BinForms
are submitted for create, a
CreateResponse
is returned for each BinForm,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createBins(),
errors specific to an individual BinForm
are indicated in
the corresponding CreateResponse.
CreateResponses
may be linked to the originating BinForm
through
the BinForm
Id
.
For updates, BinForms
are requested to the Bin
Id
that is to be updated using
getBinFormsForUpdate()
where the reference Id
in
the BinForm
may be used to link the request. Similarly, the
BinForm
has metadata about the data that can be updated and
it can perform validation before submitting the update. The BinForm
can only be used once for a successful update and cannot be
reused.
Once a batch of BinForms
are submitted for update, an
UpdateResponse
is returned for each BinForm,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateBins(),
errors specific to an individual BinForm
are indicated in
the corresponding UpdateResponse.
UpdateResponses
may be linked to the originating BinForm
through
the BinForm
Id.
The delete operations delete Bins
in bulk. Bulk delete
operations return the results in DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasBins(AliasRequestList aliasRequests)
Adds an
Id to an Bin for the purpose of
creating compatibility. |
CreateResponseList |
createBins(BinBatchFormList binForms)
Creates a new set of
Bins. |
DeleteResponseList |
deleteAllBins()
Deletes all
Bins. |
DeleteResponseList |
deleteBins(IdList binIds)
Deletes bins for the given
Ids. |
BinBatchFormList |
getBinFormsForCreate(long number,
Type[] binRecordTypes)
Gets the bin forms for creating a bunch of new bins.
|
BinBatchFormList |
getBinFormsForUpdate(IdList binIds)
Gets the bin forms for updating an existing set of bins.
|
UpdateResponseList |
updateBins(BinBatchFormList binForms)
Updates existing bins.
|
aliasBin, canCreateBins, canCreateBinWithRecordTypes, canDeleteBins, canManageBinAliases, canUpdateBins, createBin, deleteBin, getBinFormForCreate, getBinFormForUpdate, updateBin
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
BinBatchFormList getBinFormsForCreate(long number, Type[] binRecordTypes) throws OperationFailedException, PermissionDeniedException
number
- the number of forms to retrievebinRecordTypes
- array of bin record types to be included in
each create operation or an empty list if noneNullArgumentException
- binRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createBins(BinBatchFormList binForms) throws OperationFailedException, PermissionDeniedException
Bins.
This method returns an error
if the entire operation fails. Otherwise, the status of an individual
create operation is indicated in the BatchCreateResponse
.binForms
- the bin formsNullArgumentException
- binForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BinBatchFormList getBinFormsForUpdate(IdList binIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
binIds
- the Ids
of the Bin
NotFoundException
- an binId
is not
foundNullArgumentException
- binIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateBins(BinBatchFormList binForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.binForms
- the form containing the elements to be updatedNullArgumentException
- binForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllBins() throws OperationFailedException, PermissionDeniedException
Bins.
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteBins(IdList binIds) throws OperationFailedException, PermissionDeniedException
Ids.
binIds
- the Ids
of the bins to deleteNullArgumentException
- binIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasBins(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to an Bin
for the purpose of
creating compatibility. The primary Id
of the
Bin
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is a
pointer to another bin, 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.