Interface VaultAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
VaultBatchAdminSession
This session creates, updates, and deletes Vaults . 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
Vault , a VaultForm is requested using
getVaultFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned VaultForm
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 the
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.
For updates, VaultForms are requested to the Vault
Id that is to be updated using getVaultFormForUpdate() .
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.
The delete operations delete Vaults . It is safer to remove
all mappings to the Vault catalogs before deletion.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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.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
-
canCreateVaults
boolean canCreateVaults()Tests if this user can createVaults. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aVaultwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifVaultcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateVaultWithRecordTypes
Tests if this user can create a singleVaultusing the desired record types. WhileAuthorizationManager.getVaultRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificVault. Providing an empty array tests if aVaultcan be created with no records.- Parameters:
vaultRecordTypes- array of vault record types- Returns:
trueifVaultcreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-vaultRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getVaultFormForCreate
VaultForm getVaultFormForCreate(Type[] vaultRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the vault form for creating new vaults. A new form should be requested for each create transaction.- Parameters:
vaultRecordTypes- array of vault record types- Returns:
- the vault form
- Throws:
NullArgumentException-vaultRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form qith requested record types- Compliance:
mandatory- This method must be implemented.
-
createVault
Creates a newVault.- Parameters:
vaultForm- the form for thisVault- Returns:
- the new
Vault - Throws:
IllegalStateException-vaultFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-vaultFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-vaultFormdid not originate fromgetVaultFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateVaults
boolean canUpdateVaults()Tests if this user can updateVaults. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aVaultwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifVaultmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getVaultFormForUpdate
VaultForm getVaultFormForUpdate(Id vaultId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the vault form for updating an existing vault. A new vault form should be requested for each update transaction.- Parameters:
vaultId- theIdof theVault- Returns:
- the vault form
- Throws:
NotFoundException-vaultIdis not foundNullArgumentException-vaultIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateVault
Updates an existing vault.- Parameters:
vaultForm- the form containing the elements to be updated- Throws:
IllegalStateException-vaultFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-vaultFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-vaultFormdid not originate fromgetVaultFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteVaults
boolean canDeleteVaults()Tests if this user can delete vaults. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aVaultwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifVaultdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteVault
void deleteVault(Id vaultId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aVault.- Parameters:
vaultId- theIdof theVaultto remove- Throws:
NotFoundException-vaultIdnot foundNullArgumentException-vaultIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageVaultAliases
boolean canManageVaultAliases()Tests if this user can manageIdaliases forVaults. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifVaultaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasVault
void aliasVault(Id vaultId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aVaultfor the purpose of creating compatibility. The primaryIdof theVaultis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another vault it is reassigned to the given vaultId.- Parameters:
vaultId- theIdof aVaultaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-vaultIdnot foundNullArgumentException-vaultIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-