Package fr.gouv.vitam.storage.driver

# Class AbstractDriver

java.lang.Object
fr.gouv.vitam.storage.driver.AbstractDriver

All Implemented Interfaces:
  `VitamAutoCloseable`, `Driver`, `AutoCloseable`

Direct Known Subclasses:
  `DriverImpl`, `FakeDriverImpl`

public abstract class AbstractDriver extends Object implements Driver
This class must be the reference to create new drivers implementation compatible with vitam

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Map<String,VitamClientFactoryInterface<? extends AbstractConnection>>`
  `connectionFactories`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractDriver()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract VitamClientFactoryInterface<? extends AbstractConnection>`
  `addInternalOfferAsFactory(StorageOffer offer, Properties parameters)`
  This method must be implemented in the final Driver Implementation to add the ClientFactory to the driver
  `final 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.
  `void`
  `close()`
  `final boolean`
  `hasOffer(String offerId)`
  Return true if offer exists for the driver, false else
  `boolean`
  `isStorageOfferAvailable(String offerId)`
  The driver MUST provide a way to check the availability of the storage offer Id name.
  `final boolean`
  `removeOffer(String offer)`
  Remove one offer from the Driver (from DriverManager)

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface fr.gouv.vitam.storage.driver.Driver

  `connect, getMajorVersion, getMinorVersion, getName`

- ## Field Details

  - ### connectionFactories

    protected final Map<String,VitamClientFactoryInterface<? extends AbstractConnection>> connectionFactories

- ## Constructor Details

  - ### AbstractDriver

    public AbstractDriver()

- ## Method Details

  - ### isStorageOfferAvailable

    public boolean isStorageOfferAvailable(String offerId) throws StorageDriverException
    Description copied from interface: `Driver`
    The driver MUST provide a way to check the availability of the storage offer Id name.
    Specified by:
      `isStorageOfferAvailable` in interface `Driver`
    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

  - ### addOffer

    public final boolean addOffer(StorageOffer offer, Properties parameters)
    Description copied from interface: `Driver`
    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.

    Specified by:
      `addOffer` in interface `Driver`
    Parameters:
      `offer` - the storage offer configuration
      `parameters` - other extra parameters
    Returns:
      True if the offer was removed, false if not existing

  - ### addInternalOfferAsFactory

    protected abstract VitamClientFactoryInterface<? extends AbstractConnection> addInternalOfferAsFactory(StorageOffer offer, Properties parameters)
    This method must be implemented in the final Driver Implementation to add the ClientFactory to the driver
    Parameters:
      `offer` -
      `parameters` -
    Returns:
      true if added

  - ### removeOffer

    public final boolean removeOffer(String offer)
    Description copied from interface: `Driver`
    Remove one offer from the Driver (from DriverManager)
    Specified by:
      `removeOffer` in interface `Driver`
    Parameters:
      `offer` -
    Returns:
      True if the offer was removed, false if not existing

  - ### hasOffer

    public final boolean hasOffer(String offerId)
    Description copied from interface: `Driver`
    Return true if offer exists for the driver, false else
    Specified by:
      `hasOffer` in interface `Driver`
    Parameters:
      `offerId` -
    Returns:
      True if the offer is declared in the driver

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `VitamAutoCloseable`