Interface Driver

All Superinterfaces:
AutoCloseable, VitamAutoCloseable
All Known Implementing Classes:
AbstractDriver, DriverImpl, FakeDriverImpl

public interface Driver extends VitamAutoCloseable
Driver interface that all storage offer drivers MUST implement to be discovered by the Vitam driver manager.
It describes all the services the storage offer MUST at least provide to the Vitam engine.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addOffer(StorageOffer offer, Properties parameters)
    Add one offer to the Driver (from DriverManager) The driver MUST provide a way to check the availability of the storage offer based on storage offer and configuration parameters.
    connect(String offerId)
    Create a connection to the distant offer service based on given offer Id name.
    int
    Retrieves the driver's major version number.
    int
    Retrieves the driver's minor version number.
    The driver implementation MUST provide a constant name which SHOULD be shared accross instances of the same driver implementation.
    boolean
    hasOffer(String offerId)
    Return true if offer exists for the driver, false else
    boolean
    The driver MUST provide a way to check the availability of the storage offer Id name.
    boolean
    Remove one offer from the Driver (from DriverManager)

    Methods inherited from interface fr.gouv.vitam.common.model.VitamAutoCloseable

    close
  • Method Details

    • connect

      @Nonnull Connection connect(String offerId) throws StorageDriverException
      Create a connection to the distant offer service based on given offer Id name. If no connection could be made, the driver MUST throw a StorageException
      Parameters:
      offerId - the offerId name
      Returns:
      a connection which MUST contains all necessary parameters and initial configurations to allow further requests to the distant offer service without needing to pass parameters/configurations.
      Throws:
      StorageDriverException - if any problem occurs during connection
    • isStorageOfferAvailable

      boolean isStorageOfferAvailable(String offerId) throws StorageDriverException
      The driver MUST provide a way to check the availability of the storage offer Id name.
      Parameters:
      offerId - the offerId name
      Returns:
      MUST return true if the distant offer service is available to accept further requests, false otherwise, including if the offer is not yet added
      Throws:
      StorageDriverException - if any problem occurs during request
    • removeOffer

      boolean removeOffer(String offer)
      Remove one offer from the Driver (from DriverManager)
      Parameters:
      offer -
      Returns:
      True if the offer was removed, false if not existing
    • addOffer

      boolean addOffer(StorageOffer offer, Properties parameters)
      Add one offer to the Driver (from DriverManager) The driver MUST provide a way to check the availability of the storage offer based on storage offer and configuration parameters. For example it can be used to pass user and password properties in for authentication.

      The parameters argument can also be used to pass arbitrary string tag/value pairs as connection arguments.

      Parameters:
      offer - the storage offer configuration
      parameters - other extra parameters
      Returns:
      True if the offer was removed, false if not existing
    • hasOffer

      boolean hasOffer(String offerId)
      Return true if offer exists for the driver, false else
      Parameters:
      offerId -
      Returns:
      True if the offer is declared in the driver
    • getName

      String getName()
      The driver implementation MUST provide a constant name which SHOULD be shared accross instances of the same driver implementation. Then it is strongly recommended to use a static final field in your driver implementation.

      This name MAY be used in user interface to provide information on the driver.

      Returns:
      The name of the driver which SHOULD be constant
    • getMajorVersion

      int getMajorVersion()
      Retrieves the driver's major version number.

      This number MAY be used in user interface to provide information on the driver.

      Returns:
      this driver's major version number
    • getMinorVersion

      int getMinorVersion()
      Retrieves the driver's minor version number.

      This number MAY be used in user interface to provide information on the driver.

      Returns:
      this driver's minor version number