Class DriverManager
- java.lang.Object
-
- fr.gouv.vitam.storage.engine.server.spi.DriverManager
-
public class DriverManager extends java.lang.ObjectDriverManager 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DriveraddDriver(Driver driver)Add a driver from the DriverManagerstatic voidaddOffersToDriver(java.lang.String name, java.util.List<java.lang.String> offerIds)Add offer to a driverstatic voidaddOfferToDriver(java.lang.String name, java.lang.String offerId)Add offer to a driverstatic voidchangeDriverMapper(DriverMapper newMapper)Change the driver mapperstatic DrivergetDriverFor(java.lang.String offerId)Get the driver for one offerstatic voidremoveOffer(java.lang.String offerId)Remove one offer to a driver
-
-
-
Method Detail
-
addDriver
public static Driver addDriver(Driver driver)
Add a driver from the DriverManager- Parameters:
driver-- Returns:
- this
-
changeDriverMapper
public static void changeDriverMapper(DriverMapper newMapper)
Change the driver mapper- Parameters:
newMapper- the driver mapper to use
-
addOfferToDriver
public static void addOfferToDriver(java.lang.String name, java.lang.String offerId) throws StorageDriverMapperExceptionAdd 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(java.lang.String name, java.util.List<java.lang.String> offerIds) throws StorageDriverMapperExceptionAdd 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(java.lang.String offerId) throws StorageDriverMapperException, StorageDriverNotFoundExceptionRemove 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
public static Driver getDriverFor(java.lang.String offerId) throws StorageDriverNotFoundException
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)
-
-