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
This class must be the reference to create new drivers implementation compatible with vitam
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,VitamClientFactoryInterface<? extends AbstractConnection>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 driverfinal booleanaddOffer(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.voidclose()final booleanReturn true if offer exists for the driver, false elsebooleanisStorageOfferAvailable(String offerId) The driver MUST provide a way to check the availability of the storage offer Id name.final booleanremoveOffer(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, waitMethods 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
Description copied from interface:DriverThe driver MUST provide a way to check the availability of the storage offer Id name.- Specified by:
isStorageOfferAvailablein interfaceDriver- 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
Description copied from interface:DriverAdd 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.
-
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
Description copied from interface:DriverRemove one offer from the Driver (from DriverManager)- Specified by:
removeOfferin interfaceDriver- Returns:
- True if the offer was removed, false if not existing
-
hasOffer
Description copied from interface:DriverReturn true if offer exists for the driver, false else -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-