Interface VaultAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
VaultBatchAdminSession

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.

  • Method Details

    • canCreateVaults

      boolean canCreateVaults()
      Tests if this user can create 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.
      Returns:
      false if Vault creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateVaultWithRecordTypes

      boolean canCreateVaultWithRecordTypes(Type[] vaultRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      vaultRecordTypes - array of vault record types
      Returns:
      true if Vault creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - vaultRecordTypes is null
      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 - vaultRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form qith requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createVault

      Creates a new Vault .
      Parameters:
      vaultForm - the form for this Vault
      Returns:
      the new Vault
      Throws:
      IllegalStateException - vaultForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - vaultForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - vaultForm did not originate from getVaultFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateVaults

      boolean canUpdateVaults()
      Tests if this user can update 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.
      Returns:
      false if Vault modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getVaultFormForUpdate

      Gets the vault form for updating an existing vault. A new vault form should be requested for each update transaction.
      Parameters:
      vaultId - the Id of the Vault
      Returns:
      the vault form
      Throws:
      NotFoundException - vaultId is not found
      NullArgumentException - vaultId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateVault

      void updateVault(VaultForm vaultForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing vault.
      Parameters:
      vaultForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - vaultForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - vaultForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - vaultForm did not originate from getVaultFormForUpdate()
      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 a 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.
      Returns:
      false if Vault deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteVault

      Deletes a Vault .
      Parameters:
      vaultId - the Id of the Vault to remove
      Throws:
      NotFoundException - vaultId not found
      NullArgumentException - vaultId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageVaultAliases

      boolean canManageVaultAliases()
      Tests if this user can manage 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.
      Returns:
      false if Vault aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasVault

      Adds an 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 .
      Parameters:
      vaultId - the Id of a Vault
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - vaultId not found
      NullArgumentException - vaultId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.