Search in sources :

Example 6 with AbstractStorageDriver

use of com.emc.storageos.storagedriver.AbstractStorageDriver in project coprhd-controller by CoprHD.

the class ExternalBlockStorageDevice method getDriver.

public synchronized BlockStorageDriver getDriver(String driverType) {
    // look up driver
    BlockStorageDriver storageDriver = blockDrivers.get(driverType);
    if (storageDriver != null) {
        return storageDriver;
    } else {
        // init driver
        AbstractStorageDriver driver = drivers.get(driverType);
        if (driver == null) {
            _log.error("No driver entry defined for device type: {} . ", driverType);
            throw ExternalDeviceException.exceptions.noDriverDefinedForDevice(driverType);
        }
        init(driver);
        blockDrivers.put(driverType, (BlockStorageDriver) driver);
        return (BlockStorageDriver) driver;
    }
}
Also used : AbstractStorageDriver(com.emc.storageos.storagedriver.AbstractStorageDriver) BlockStorageDriver(com.emc.storageos.storagedriver.BlockStorageDriver)

Aggregations

AbstractStorageDriver (com.emc.storageos.storagedriver.AbstractStorageDriver)6 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)4 ExternalDeviceCollectionException (com.emc.storageos.volumecontroller.impl.externaldevice.ExternalDeviceCollectionException)3 HashMap (java.util.HashMap)3 StorageSystemType (com.emc.storageos.db.client.model.StorageSystemType)2 ArrayList (java.util.ArrayList)2 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 StringMap (com.emc.storageos.db.client.model.StringMap)1 StringSet (com.emc.storageos.db.client.model.StringSet)1 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)1 StorageSystemViewObject (com.emc.storageos.plugins.StorageSystemViewObject)1 BlockStorageDriver (com.emc.storageos.storagedriver.BlockStorageDriver)1 DriverTask (com.emc.storageos.storagedriver.DriverTask)1 StoragePort (com.emc.storageos.storagedriver.model.StoragePort)1 StorageProvider (com.emc.storageos.storagedriver.model.StorageProvider)1 StorageSystem (com.emc.storageos.storagedriver.model.StorageSystem)1 ExternalBlockStorageDevice (com.emc.storageos.volumecontroller.impl.externaldevice.ExternalBlockStorageDevice)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1