Search in sources :

Example 6 with Controller

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

the class BlockControllerImpl method activateSnapshot.

@Override
public void activateSnapshot(URI storage, List<URI> snapshotList, String opId) throws InternalException {
    try {
        // Direct RMI call to expedite this call without any potential distribute-Q delay
        StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
        Controller controller = lookupDeviceController(storageSystem);
        BlockController blkcontroller = (BlockController) controller;
        blkcontroller.activateSnapshot(storage, snapshotList, opId);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
            _log.error(e.getMessage(), e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 7 with Controller

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

the class BlockControllerImpl method checkSyncProgress.

@Override
public Integer checkSyncProgress(URI storage, URI source, URI target, String opId) {
    try {
        StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
        Controller controller = lookupDeviceController(storageSystem);
        BlockController blkcontroller = (BlockController) controller;
        return blkcontroller.checkSyncProgress(storage, source, target, opId);
    } catch (RetryableDatabaseException e) {
        if (e.getServiceCode() == ServiceCode.DBSVC_CONNECTION_ERROR) {
            // netflix curator ConnectionException is not serializable
            // and thus should not be sent back to rmi client.
            _log.error("Failed to queue task due to dbsvc disconnected. Error: {}", e.getMessage());
            _log.error(e.getMessage(), e);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 8 with Controller

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

the class BlockControllerImpl method validateStorageProviderConnection.

@Override
public boolean validateStorageProviderConnection(String ipAddress, Integer portNumber, String interfaceType) {
    // Making a direct call to get connection status.
    Controller controller = lookupDeviceController();
    BlockController blkcontroller = (BlockController) controller;
    return blkcontroller.validateStorageProviderConnection(ipAddress, portNumber, interfaceType);
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController)

Example 9 with Controller

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

the class BlockControllerImpl method getInitiatorAlias.

@Override
public String getInitiatorAlias(URI systemURI, URI initiatorURI) throws Exception {
    // Making a direct call to get alias.
    Controller controller = lookupDeviceController();
    BlockController blkcontroller = (BlockController) controller;
    return blkcontroller.getInitiatorAlias(systemURI, initiatorURI);
}
Also used : BlockController(com.emc.storageos.volumecontroller.BlockController) Controller(com.emc.storageos.Controller) BlockController(com.emc.storageos.volumecontroller.BlockController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController)

Example 10 with Controller

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

the class RPControllerImpl method getCopyAccessStates.

@Override
public Map<URI, String> getCopyAccessStates(URI protectionDevice, List<URI> volumeURIs) {
    final DiscoveredSystemObject device = _dbClient.queryObject(ProtectionSystem.class, protectionDevice);
    final Controller controller = lookupDeviceController(device);
    // Try to grab a handle on the RPDeviceController so we can call directly into it.
    if (controller instanceof RPDeviceController) {
        return ((RPDeviceController) controller).getCopyAccessStates(protectionDevice, volumeURIs);
    }
    // Problem calling the controller so just return an empty map
    return new HashMap<URI, String>();
}
Also used : RPDeviceController(com.emc.storageos.protectioncontroller.impl.recoverpoint.RPDeviceController) HashMap(java.util.HashMap) DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) RPController(com.emc.storageos.protectioncontroller.RPController) Controller(com.emc.storageos.Controller) RPDeviceController(com.emc.storageos.protectioncontroller.impl.recoverpoint.RPDeviceController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController)

Aggregations

Controller (com.emc.storageos.Controller)12 AbstractDiscoveredSystemController (com.emc.storageos.impl.AbstractDiscoveredSystemController)9 BlockController (com.emc.storageos.volumecontroller.BlockController)7 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)5 RetryableDatabaseException (com.emc.storageos.db.exceptions.RetryableDatabaseException)5 DiscoveredSystemObject (com.emc.storageos.db.client.model.DiscoveredSystemObject)2 HashMap (java.util.HashMap)2 DataObject (com.emc.storageos.db.client.model.DataObject)1 RPController (com.emc.storageos.protectioncontroller.RPController)1 RPDeviceController (com.emc.storageos.protectioncontroller.impl.recoverpoint.RPDeviceController)1 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)1 ObjectController (com.emc.storageos.volumecontroller.ObjectController)1 Method (java.lang.reflect.Method)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1