Interface DepotBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DepotAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Depots 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
Depot , an DepotForm is requested using
getDepotFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
DepotForms 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 DepotForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each DepotForm corresponds to an attempted
transaction.
The DepotForms returned from getDepotFormsForCreate()
may be linked to the originating request through the peer Ids of
the DepotForm . In the case where there may be duplicates, any
DepotForm of the same peer Ids may be used for a create
operation.
Once a batch of DepotForms are submitted for create, a
CreateResponse is returned for each DepotForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createDepots() , errors specific to an
individual DepotForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
DepotForm through the DepotForm Id .
For updates, DepotForms are requested to the Depot
Id that is to be updated using getDepotFormsForUpdate()
where the reference Id in the DepotForm may be used to
link the request. Similarly, the DepotForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The DepotForm can only be used once for a successful
update and cannot be reused.
Once a batch of DepotForms are submitted for update, an
UpdateResponse is returned for each DepotForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateDepots() , errors specific to an
individual DepotForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
DepotForm through the DepotForm Id .
The delete operations delete Depots in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDepots(AliasRequestList aliasRequests) Adds anIdto anDepotfor the purpose of creating compatibility.createDepots(DepotBatchFormList depotForms) Creates a new set ofDepots.Deletes allDepots.deleteDepots(IdList depotIds) Deletes depots for the givenIds.getDepotFormsForCreate(long number, Type[] depotRecordTypes) Gets the depot forms for creating a bunch of new depots.getDepotFormsForUpdate(IdList depotIds) Gets the depot forms for updating an existing set of depots.updateDepots(DepotBatchFormList depotForms) Updates existing depots.Methods inherited from interface DepotAdminSession
aliasDepot, canCreateDepots, canCreateDepotWithRecordTypes, canDeleteDepot, canDeleteDepots, canManageDepotAliases, canUpdateDepot, canUpdateDepots, createDepot, deleteDepot, getDepotFormForCreate, getDepotFormForUpdate, updateDepotModifier and TypeMethodDescriptionvoidaliasDepot(Id depotId, Id aliasId) Adds anIdto aDepotfor the purpose of creating compatibility.booleanTests if this user can createDepots.booleancanCreateDepotWithRecordTypes(Type[] depotRecordTypes) Tests if this user can create a singleDepotusing the desired record types.booleancanDeleteDepot(Id depotId) Tests if this user can delete a specifiedDepot.booleanTests if this user can delete depots.booleanTests if this user can manageIdaliases forDepots.booleancanUpdateDepot(Id depotId) Tests if this user can update a specifiedDepot.booleanTests if this user can updateDepots.createDepot(DepotForm depotForm) Creates a newDepot.voiddeleteDepot(Id depotId) Deletes aDepot.getDepotFormForCreate(Type[] depotRecordTypes) Gets the depot form for creating new depots.getDepotFormForUpdate(Id depotId) Gets the depot form for updating an existing depot.voidupdateDepot(DepotForm depotForm) Updates an existing depot.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
-
getDepotFormsForCreate
DepotBatchFormList getDepotFormsForCreate(long number, Type[] depotRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the depot forms for creating a bunch of new depots.- Parameters:
number- the number of forms to retrievedepotRecordTypes- array of depot record types to be included in each create operation or an empty list if none- Returns:
- the depot forms
- Throws:
NullArgumentException-depotRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDepots
CreateResponseList createDepots(DepotBatchFormList depotForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDepots. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
depotForms- the depot forms- Returns:
- the create responses
- Throws:
NullArgumentException-depotFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDepotFormsForUpdate
DepotBatchFormList getDepotFormsForUpdate(IdList depotIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the depot forms for updating an existing set of depots. A new depot form should be requested for each update transaction.- Parameters:
depotIds- theIdsof theDepot- Returns:
- the depot form
- Throws:
NotFoundException- andepotIdis not foundNullArgumentException-depotIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDepots
UpdateResponseList updateDepots(DepotBatchFormList depotForms) throws OperationFailedException, PermissionDeniedException Updates existing depots. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
depotForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-depotFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDepots
Deletes allDepots.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDepots
DeleteResponseList deleteDepots(IdList depotIds) throws OperationFailedException, PermissionDeniedException Deletes depots for the givenIds.- Parameters:
depotIds- theIdsof the depots to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-depotIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDepots
AliasResponseList aliasDepots(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anDepotfor the purpose of creating compatibility. The primaryIdof theDepotis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another depot, it is reassigned to the given depotId.- 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.
-