Interface VaultBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, VaultAdminSession
This session creates, updates, and deletes Vaults 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
Vault , an VaultForm is requested using
getVaultFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
VaultForms 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 VaultForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each VaultForm corresponds to an attempted
transaction.
The VaultForms returned from getVaultFormsForCreate()
may be linked to the originating request through the peer Ids of
the VaultForm . In the case where there may be duplicates, any
VaultForm of the same peer Ids may be used for a create
operation.
Once a batch of VaultForms are submitted for create, a
CreateResponse is returned for each VaultForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createVaults() , errors specific to an
individual VaultForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
VaultForm through the VaultForm Id .
For updates, VaultForms are requested to the Vault
Id that is to be updated using getVaultFormsForUpdate()
where the reference Id in the VaultForm may be used to
link the request. Similarly, the VaultForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The VaultForm can only be used once for a successful
update and cannot be reused.
Once a batch of VaultForms are submitted for update, an
UpdateResponse is returned for each VaultForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateVaults() , errors specific to an
individual VaultForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
VaultForm through the VaultForm Id .
The delete operations delete Vaults in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasVaults(AliasRequestList aliasRequests) Adds anIdto anVaultfor the purpose of creating compatibility.createVaults(VaultBatchFormList vaultForms) Creates a new set ofVaults.Deletes allVaults.deleteVaults(IdList vaultIds) Deletes vaults for the givenIds.getVaultFormsForCreate(long number, Type[] vaultRecordTypes) Gets the vault forms for creating a bunch of new vaults.getVaultFormsForUpdate(IdList vaultIds) Gets the vault forms for updating an existing set of vaults.updateVaults(VaultBatchFormList vaultForms) Updates existing vaults.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.Methods inherited from interface VaultAdminSession
aliasVault, canCreateVaults, canCreateVaultWithRecordTypes, canDeleteVaults, canManageVaultAliases, canUpdateVaults, createVault, deleteVault, getVaultFormForCreate, getVaultFormForUpdate, updateVaultModifier and TypeMethodDescriptionvoidaliasVault(Id vaultId, Id aliasId) Adds anIdto aVaultfor the purpose of creating compatibility.booleanTests if this user can createVaults.booleancanCreateVaultWithRecordTypes(Type[] vaultRecordTypes) Tests if this user can create a singleVaultusing the desired record types.booleanTests if this user can delete vaults.booleanTests if this user can manageIdaliases forVaults.booleanTests if this user can updateVaults.createVault(VaultForm vaultForm) Creates a newVault.voiddeleteVault(Id vaultId) Deletes aVault.getVaultFormForCreate(Type[] vaultRecordTypes) Gets the vault form for creating new vaults.getVaultFormForUpdate(Id vaultId) Gets the vault form for updating an existing vault.voidupdateVault(VaultForm vaultForm) Updates an existing vault.
-
Method Details
-
getVaultFormsForCreate
VaultBatchFormList getVaultFormsForCreate(long number, Type[] vaultRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the vault forms for creating a bunch of new vaults.- Parameters:
number- the number of forms to retrievevaultRecordTypes- array of vault record types to be included in each create operation or an empty list if none- Returns:
- the vault forms
- Throws:
NullArgumentException-vaultRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createVaults
CreateResponseList createVaults(VaultBatchFormList vaultForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofVaults. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
vaultForms- the vault forms- Returns:
- the create responses
- Throws:
NullArgumentException-vaultFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVaultFormsForUpdate
VaultBatchFormList getVaultFormsForUpdate(IdList vaultIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the vault forms for updating an existing set of vaults. A new vault form should be requested for each update transaction.- Parameters:
vaultIds- theIdsof theVault- Returns:
- the vault form
- Throws:
NotFoundException- anvaultIdis not foundNullArgumentException-vaultIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateVaults
UpdateResponseList updateVaults(VaultBatchFormList vaultForms) throws OperationFailedException, PermissionDeniedException Updates existing vaults. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
vaultForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-vaultFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllVaults
Deletes allVaults.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteVaults
DeleteResponseList deleteVaults(IdList vaultIds) throws OperationFailedException, PermissionDeniedException Deletes vaults for the givenIds.- Parameters:
vaultIds- theIdsof the vaults to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-vaultIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasVaults
AliasResponseList aliasVaults(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anVaultfor the purpose of creating compatibility. The primaryIdof theVaultis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another vault, 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.
-