public interface VaultAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasVault(Id vaultId,
Id aliasId)
Adds an
Id to a Vault for the purpose of
creating compatibility. |
boolean |
canCreateVaults()
Tests if this user can create
Vaults. |
boolean |
canCreateVaultWithRecordTypes(Type[] vaultRecordTypes)
Tests if this user can create a single
Vault using the
desired record types. |
boolean |
canDeleteVaults()
Tests if this user can delete vaults.
|
boolean |
canManageVaultAliases()
Tests if this user can manage
Id aliases for
Vaults. |
boolean |
canUpdateVaults()
Tests if this user can update
Vaults. |
Vault |
createVault(VaultForm vaultForm)
Creates a new
Vault. |
void |
deleteVault(Id vaultId)
Deletes a
Vault. |
VaultForm |
getVaultFormForCreate(Type[] vaultRecordTypes)
Gets the vault form for creating new vaults.
|
VaultForm |
getVaultFormForUpdate(Id vaultId)
Gets the vault form for updating an existing vault.
|
void |
updateVault(VaultForm vaultForm)
Updates an existing vault.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateVaults()
Vaults. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Vault will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may not wish to offer create operations to
unauthorized users. false if Vault creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateVaultWithRecordTypes(Type[] vaultRecordTypes)
Vault using the
desired record types. While
AuthorizationManager.getVaultRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Vault. Providing
an empty array tests if a Vault can be created with no
records.vaultRecordTypes - array of vault record types true if Vault creation using the
specified Types is supported, false
otherwiseNullArgumentException - vaultRecordTypes
is null mandatory - This method must be implemented. VaultForm getVaultFormForCreate(Type[] vaultRecordTypes) throws OperationFailedException, PermissionDeniedException
vaultRecordTypes - array of vault record typesNullArgumentException - vaultRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form qith
requested record typesmandatory - This method must be implemented. Vault createVault(VaultForm vaultForm) throws OperationFailedException, PermissionDeniedException
Vault. vaultForm - the form for this Vault Vault IllegalStateException - vaultForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - vaultForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - vaultForm did not
originate from getVaultFormForCreate() mandatory - This method must be implemented. boolean canUpdateVaults()
Vaults. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Vault will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may not wish to offer update operations to
unauthorized users. false if Vault modification is
not authorized, true otherwisemandatory - This method must be implemented. VaultForm getVaultFormForUpdate(Id vaultId) throws NotFoundException, OperationFailedException, PermissionDeniedException
vaultId - the Id of the Vault NotFoundException - vaultId is not foundNullArgumentException - vaultId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateVault(VaultForm vaultForm) throws OperationFailedException, PermissionDeniedException
vaultForm - the form containing the elements to be updatedIllegalStateException - vaultForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - vaultForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - vaultForm did not
originate from getVaultFormForUpdate() mandatory - This method must be implemented. boolean canDeleteVaults()
Vault will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false if Vault deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteVault(Id vaultId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Vault. vaultId - the Id of the Vault to
removeNotFoundException - vaultId not foundNullArgumentException - vaultId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageVaultAliases()
Id aliases for
Vaults. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Vault aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasVault(Id vaultId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Vault for the purpose of
creating compatibility. The primary Id of the
Vault is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another vault it is reassigned to the given vault
Id. vaultId - the Id of a Vault aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - vaultId not foundNullArgumentException - vaultId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.