Class AbstractDriver

  • All Implemented Interfaces:
    VitamAutoCloseable, Driver, java.lang.AutoCloseable
    Direct Known Subclasses:
    DriverImpl, FakeDriverImpl

    public abstract class AbstractDriver
    extends java.lang.Object
    implements Driver
    This class must be the reference to create new drivers implementation compatible with vitam
    • Constructor Detail

      • AbstractDriver

        public AbstractDriver()
    • Method Detail

      • isStorageOfferAvailable

        public boolean isStorageOfferAvailable​(java.lang.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,
                                      java.util.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<AbstractConnection> addInternalOfferAsFactory​(StorageOffer offer,
                                                                                                     java.util.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​(java.lang.String offer)
        Description copied from interface: Driver
        Remove one offer from the Driver (from DriverManager)
        Specified by:
        removeOffer in interface Driver
        Returns:
        True if the offer was removed, false if not existing
      • hasOffer

        public final boolean hasOffer​(java.lang.String offerId)
        Description copied from interface: Driver
        Return true if offer exists for the driver, false else
        Specified by:
        hasOffer in interface Driver
        Returns:
        True if the offer is declared in the driver
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface VitamAutoCloseable