Interface Driver

  • All Superinterfaces:
    java.lang.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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean addOffer​(StorageOffer offer, java.util.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.
      Connection connect​(java.lang.String offerId)
      Create a connection to the distant offer service based on given offer Id name.
      int getMajorVersion()
      Retrieves the driver's major version number.
      int getMinorVersion()
      Retrieves the driver's minor version number.
      java.lang.String getName()
      The driver implementation MUST provide a constant name which SHOULD be shared accross instances of the same driver implementation.
      boolean hasOffer​(java.lang.String offerId)
      Return true if offer exists for the driver, false else
      boolean isStorageOfferAvailable​(java.lang.String offerId)
      The driver MUST provide a way to check the availability of the storage offer Id name.
      boolean removeOffer​(java.lang.String offer)
      Remove one offer from the Driver (from DriverManager)
    • Method Detail

      • connect

        Connection connect​(java.lang.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​(java.lang.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​(java.lang.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,
                         java.util.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​(java.lang.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

        java.lang.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