Class DriverManager
java.lang.Object
fr.gouv.vitam.storage.engine.server.spi.DriverManager
DriverManager implementation.
Use to register storage driver and associates it with offers.
Actually, it is not possible to append driver without a server restart (you can append the driver, do association with offers but you have to restart the server to have the new driver).
-
Method Summary
Modifier and TypeMethodDescriptionstatic Driver
Add a driver from the DriverManagerstatic void
addOffersToDriver
(String name, List<String> offerIds) Add offer to a driverstatic void
addOfferToDriver
(String name, String offerId) Add offer to a driverstatic void
changeDriverMapper
(DriverMapper newMapper) Change the driver mapperstatic Driver
getDriverFor
(String offerId) Get the driver for one offerstatic void
removeOffer
(String offerId) Remove one offer to a driver
-
Method Details
-
addDriver
Add a driver from the DriverManager- Parameters:
driver
-- Returns:
- this
-
changeDriverMapper
Change the driver mapper- Parameters:
newMapper
- the driver mapper to use
-
addOfferToDriver
public static void addOfferToDriver(String name, String offerId) throws StorageDriverMapperException Add offer to a driver- Parameters:
name
- the driver nameofferId
- the offer ID to append- Throws:
StorageDriverMapperException
- thrown if error on driver mapper (persisting part) append
-
addOffersToDriver
public static void addOffersToDriver(String name, List<String> offerIds) throws StorageDriverMapperException Add offer to a driver- Parameters:
name
- the driver nameofferIds
- the offer ID to append- Throws:
StorageDriverMapperException
- thrown if error on driver mapper (persisting part) append
-
removeOffer
public static void removeOffer(String offerId) throws StorageDriverMapperException, StorageDriverNotFoundException Remove one offer to a driver- Parameters:
offerId
- the offer ID to remove- Throws:
StorageDriverMapperException
- thrown if error on driver mapper (persisting part) appendStorageDriverNotFoundException
- thrown if the associated driver is not found (no driver / offer association)
-
getDriverFor
Get the driver for one offer- Parameters:
offerId
- required the offer ID- Returns:
- the associated driver
- Throws:
StorageDriverNotFoundException
- thrown if the associated driver is not found (no driver / offer association)
-