Interface DepotAdminSession

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

public interface DepotAdminSession extends OsidSession

This session creates, updates, and deletes Depots . 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 Depot , a DepotForm is requested using getDepotFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned DepotForm 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 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.

For updates, DepotForms are requested to the Depot Id that is to be updated using getDepotFormForUpdate() . Similarly, the DepotForm has metadata about the data that can be updated and it can perform validation before submitting the update. The Depot can only be used once for a successful update and cannot be reused.

The delete operations delete Depots .This session also includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateDepots

      boolean canCreateDepots()
      Tests if this user can create Depots . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Depot 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 Depot creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateDepotWithRecordTypes

      boolean canCreateDepotWithRecordTypes(Type[] depotRecordTypes)
      Tests if this user can create a single Depot using the desired record types. While InstallationManager.getDepotRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Depot . Providing an empty array tests if a Depot can be created with no records.
      Parameters:
      depotRecordTypes - array of depot record types
      Returns:
      true if Depot creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - depotRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getDepotFormForCreate

      DepotForm getDepotFormForCreate(Type[] depotRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the depot form for creating new depots. A new form should be requested for each create transaction.
      Parameters:
      depotRecordTypes - array of depot record types
      Returns:
      the depot form
      Throws:
      NullArgumentException - depotRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createDepot

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

      boolean canUpdateDepots()
      Tests if this user can update Depots . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Depot 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 Depot modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateDepot

      boolean canUpdateDepot(Id depotId)
      Tests if this user can update a specified Depot . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating the Depot 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.
      Parameters:
      depotId - the Id of the Depot
      Returns:
      false if depot modification is not authorized, true otherwise
      Throws:
      NullArgumentException - depotId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code depotId} is not found, then it is acceptable to return false to indicate the lack of an update available.
    • getDepotFormForUpdate

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

      void updateDepot(DepotForm depotForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing depot.
      Parameters:
      depotForm - the form containing the elements to be updated
      Throws:
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - depotForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - depotForm did not originate from getDepotFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteDepots

      boolean canDeleteDepots()
      Tests if this user can delete depots. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Depot 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 Depot deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteDepot

      boolean canDeleteDepot(Id depotId)
      Tests if this user can delete a specified Depot . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the Depot 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.
      Parameters:
      depotId - the Id of the Depot
      Returns:
      false if deletion of this Depot is not authorized, true otherwise
      Throws:
      NullArgumentException - depotId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code depotId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
    • deleteDepot

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

      boolean canManageDepotAliases()
      Tests if this user can manage Id aliases for Depots . 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 Depot aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasDepot

      Adds an Id to a Depot for the purpose of creating compatibility. The primary Id of the Depot is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another depot it is reassigned to the given depot Id .
      Parameters:
      depotId - the Id of a Depot
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - depotId not found
      NullArgumentException - depotId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.