Search in sources :

Example 1 with Controller

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

the class AbstractDiscoveredSystemController method queueTask.

protected void queueTask(DbClient dbClient, Class<? extends DiscoveredSystemObject> systemClazz, Dispatcher dispatcher, String methodName, Object... args) {
    final URI systemURI = (URI) args[0];
    _log.info("System {} received RMI request {}.", systemURI, methodName);
    try {
        // 1. select target device
        final DiscoveredSystemObject device = dbClient.queryObject(systemClazz, systemURI);
        final Controller controller = lookupDeviceController(device);
        // 2. queue request
        dispatcher.queue(device.getId(), device.getSystemType(), controller, methodName, args);
    } 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);
            throw DatabaseException.retryables.connectionFailed();
        }
        throw e;
    }
}
Also used : DiscoveredSystemObject(com.emc.storageos.db.client.model.DiscoveredSystemObject) Controller(com.emc.storageos.Controller) URI(java.net.URI) RetryableDatabaseException(com.emc.storageos.db.exceptions.RetryableDatabaseException)

Example 2 with Controller

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

the class ObjectControllerImpl method addUserSecretKey.

@Override
public ObjectUserSecretKey addUserSecretKey(URI storage, String userId, String secretKey) throws InternalException {
    _log.debug("ObjectControllerImpl:addUserSecretKey start");
    // Synchronous call than queuing
    StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
    Controller controller = lookupDeviceController(storageSystem);
    ObjectController objController = (ObjectController) controller;
    return objController.addUserSecretKey(storage, userId, secretKey);
}
Also used : ObjectController(com.emc.storageos.volumecontroller.ObjectController) Controller(com.emc.storageos.Controller) ObjectController(com.emc.storageos.volumecontroller.ObjectController) AbstractDiscoveredSystemController(com.emc.storageos.impl.AbstractDiscoveredSystemController) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Example 3 with Controller

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

the class BlockControllerImpl method pauseNativeContinuousCopies.

@Override
public void pauseNativeContinuousCopies(URI storage, List<URI> mirrors, Boolean sync, 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.pauseNativeContinuousCopies(storage, mirrors, sync, 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 4 with Controller

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

the class BlockControllerImpl method setInitiatorAlias.

@Override
public void setInitiatorAlias(URI systemURI, URI initiatorURI, String initiatorAlias) throws Exception {
    // Making a direct call to set alias.
    Controller controller = lookupDeviceController();
    BlockController blkcontroller = (BlockController) controller;
    blkcontroller.setInitiatorAlias(systemURI, initiatorURI, initiatorAlias);
}
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 5 with Controller

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

the class BlockControllerImpl method activateFullCopy.

@Override
public void activateFullCopy(URI storage, List<URI> fullCopy, String opId) {
    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.activateFullCopy(storage, fullCopy, 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)

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