Package fr.gouv.vitam.storage.driver
Class AbstractDriver
- java.lang.Object
-
- fr.gouv.vitam.storage.driver.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
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,VitamClientFactoryInterface<? extends AbstractConnection>>
connectionFactories
-
Constructor Summary
Constructors Constructor Description AbstractDriver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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 driverboolean
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.void
close()
boolean
hasOffer(java.lang.String offerId)
Return true if offer exists for the driver, false elseboolean
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)-
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 Detail
-
connectionFactories
protected final java.util.Map<java.lang.String,VitamClientFactoryInterface<? extends AbstractConnection>> connectionFactories
-
-
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 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
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.
-
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 interfaceDriver
- 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
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
-