public class DriverManager extends Object
Modifier and Type | Method and Description |
---|---|
static Driver |
addDriver(Driver driver)
Add a driver from the DriverManager
|
static void |
addOffersToDriver(String name,
List<String> offerIds)
Add offer to a driver
|
static void |
addOfferToDriver(String name,
String offerId)
Add offer to a driver
|
static void |
changeDriverMapper(DriverMapper newMapper)
Change the driver mapper
|
static Driver |
getDriver(String driverName) |
static Driver |
getDriverFor(String offerId)
Get the driver for one offer
|
static Driver |
removeDriver(String driverName)
Remove a Driver from the DriverManager and shutdown all Offers Factory attached to it
|
static void |
removeOffer(String offerId)
Remove one offer to a driver
|
public static Driver getDriver(String driverName)
driverName
- IllegalArgumentException
- if the driver does not existpublic static Driver addDriver(Driver driver)
driver
- public static Driver removeDriver(String driverName)
driverName
- public static void changeDriverMapper(DriverMapper newMapper)
newMapper
- the driver mapper to usepublic static void addOfferToDriver(String name, String offerId) throws StorageDriverMapperException
name
- the driver nameofferId
- the offer ID to appendStorageDriverMapperException
- thrown if error on driver mapper (persisting part) appendpublic static void addOffersToDriver(String name, List<String> offerIds) throws StorageDriverMapperException
name
- the driver nameofferIds
- the offer ID to appendStorageDriverMapperException
- thrown if error on driver mapper (persisting part) appendpublic static void removeOffer(String offerId) throws StorageDriverMapperException, StorageDriverNotFoundException
offerId
- the offer ID to removeStorageDriverMapperException
- thrown if error on driver mapper (persisting part) appendStorageDriverNotFoundException
- thrown if the associated driver is not found (no driver / offer
association)public static Driver getDriverFor(String offerId) throws StorageDriverNotFoundException
offerId
- required the offer IDStorageDriverNotFoundException
- thrown if the associated driver is not found (no driver / offer
association)Copyright © 2018 Vitam. All rights reserved.