Interface BinBatchAdminSession
- All Superinterfaces:
AutoCloseable, BinAdminSession, Closeable, OsidSession, OsidSession
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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBins(AliasRequestList aliasRequests) Adds anIdto anBinfor the purpose of creating compatibility.createBins(BinBatchFormList binForms) Creates a new set ofBins.Deletes allBins.deleteBins(IdList binIds) Deletes bins for the givenIds.getBinFormsForCreate(long number, Type[] binRecordTypes) Gets the bin forms for creating a bunch of new bins.getBinFormsForUpdate(IdList binIds) Gets the bin forms for updating an existing set of bins.updateBins(BinBatchFormList binForms) Updates existing bins.Methods inherited from interface BinAdminSession
aliasBin, canCreateBins, canCreateBinWithRecordTypes, canDeleteBins, canManageBinAliases, canUpdateBins, createBin, deleteBin, getBinFormForCreate, getBinFormForUpdate, updateBinModifier and TypeMethodDescriptionvoidAdds anIdto aBinfor the purpose of creating compatibility.booleanTests if this user can createBins.booleancanCreateBinWithRecordTypes(Type[] binRecordTypes) Tests if this user can create a singleBinusing the desired record types.booleanTests if this user can deleteBins.booleanTests if this user can manageIdaliases forBins.booleanTests if this user can updateBins.Creates a newBin.voidDeletes aBin.getBinFormForCreate(Type[] binRecordTypes) Gets the bin form for creating new bins.getBinFormForUpdate(Id binId) Gets the bin form for updating an existing bin.voidUpdates an existing bin.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
-
getBinFormsForCreate
BinBatchFormList getBinFormsForCreate(long number, Type[] binRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the bin forms for creating a bunch of new bins.- Parameters:
number- the number of forms to retrievebinRecordTypes- array of bin record types to be included in each create operation or an empty list if none- Returns:
- the bin forms
- Throws:
NullArgumentException-binRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBins
CreateResponseList createBins(BinBatchFormList binForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBins. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
binForms- the bin forms- Returns:
- the create responses
- Throws:
NullArgumentException-binFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBinFormsForUpdate
BinBatchFormList getBinFormsForUpdate(IdList binIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the bin forms for updating an existing set of bins. A new bin form should be requested for each update transaction.- Parameters:
binIds- theIdsof theBin- Returns:
- the bin form
- Throws:
NotFoundException- anbinIdis not foundNullArgumentException-binIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBins
UpdateResponseList updateBins(BinBatchFormList binForms) throws OperationFailedException, PermissionDeniedException Updates existing bins. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
binForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-binFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBins
Deletes allBins.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBins
DeleteResponseList deleteBins(IdList binIds) throws OperationFailedException, PermissionDeniedException Deletes bins for the givenIds.- Parameters:
binIds- theIdsof the bins to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-binIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBins
AliasResponseList aliasBins(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anBinfor the purpose of creating compatibility. The primaryIdof theBinis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another bin, 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.
-