Package fr.gouv.vitam.driver.fake

# Class FakeDriverImpl

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

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

public class FakeDriverImpl extends AbstractDriver
Driver implementation for test only

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `FakeDriverImpl.FakeConnectionImpl`
  `static interface`
  `FakeDriverImpl.ThrowableFunction<T,R>`

- ## Field Summary

  ### Fields inherited from class fr.gouv.vitam.storage.driver.AbstractDriver

  `connectionFactories`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FakeDriverImpl()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected VitamClientFactoryInterface<FakeDriverImpl.FakeConnectionImpl>`
  `addInternalOfferAsFactory(StorageOffer offer, Properties parameters)`
  This method must be implemented in the final Driver Implementation to add the ClientFactory to the driver
  `void`
  `clear()`
  `Connection`
  `connect(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.
  `String`
  `getName()`
  The driver implementation MUST provide a constant name which SHOULD be shared accross instances of the same driver implementation.
  `boolean`
  `isStorageOfferAvailable(String offerId)`
  The driver MUST provide a way to check the availability of the storage offer Id name.

  ### Methods inherited from class fr.gouv.vitam.storage.driver.AbstractDriver

  `addOffer, close, hasOffer, removeOffer`

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

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

- ## Constructor Details

  - ### FakeDriverImpl

    public FakeDriverImpl()

- ## Method Details

  - ### addInternalOfferAsFactory

    protected VitamClientFactoryInterface<FakeDriverImpl.FakeConnectionImpl> addInternalOfferAsFactory(StorageOffer offer, Properties parameters)
    Description copied from class: `AbstractDriver`
    This method must be implemented in the final Driver Implementation to add the ClientFactory to the driver
    Specified by:
      `addInternalOfferAsFactory` in class `AbstractDriver`
    Parameters:
      `offer` -
      `parameters` -
    Returns:
      true if added

  - ### connect

    @Nonnull public Connection connect(String offerId) throws StorageDriverException
    Description copied from interface: `Driver`
    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

    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`
    Overrides:
      `isStorageOfferAvailable` in class `AbstractDriver`
    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

  - ### getName

    public String getName()
    Description copied from interface: `Driver`
    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

    public int getMajorVersion()
    Description copied from interface: `Driver`
    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

    public int getMinorVersion()
    Description copied from interface: `Driver`
    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

  - ### clear

    public void clear()