Search in sources :

Example 1 with MirrorFileCreateTaskCompleter

use of com.emc.storageos.volumecontroller.impl.file.MirrorFileCreateTaskCompleter in project coprhd-controller by CoprHD.

the class FileReplicationDeviceController method createMirrorSession.

/**
 * Call to Create Mirror session on Storage Device
 *
 * @param systemURI
 * @param sourceURI
 * @param targetURI
 * @param vpoolChangeUri
 * @param opId
 * @return
 */
public boolean createMirrorSession(URI systemURI, URI sourceURI, URI targetURI, URI vpoolChangeUri, String opId) {
    log.info("Create Mirror Session between source and Target Pair");
    TaskCompleter completer = null;
    try {
        WorkflowStepCompleter.stepExecuting(opId);
        StorageSystem system = getStorageSystem(systemURI);
        completer = new MirrorFileCreateTaskCompleter(sourceURI, targetURI, vpoolChangeUri, opId);
        getRemoteMirrorDevice(system).doCreateMirrorLink(system, sourceURI, targetURI, completer);
        log.info("Source: {}", sourceURI);
        log.info("Target: {}", targetURI);
        log.info("OpId: {}", opId);
    } catch (Exception e) {
        ServiceError error = DeviceControllerException.errors.jobFailed(e);
        if (null != completer) {
            completer.error(dbClient, error);
        }
        WorkflowStepCompleter.stepFailed(opId, error);
        return false;
    }
    return true;
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) MirrorFileCreateTaskCompleter(com.emc.storageos.volumecontroller.impl.file.MirrorFileCreateTaskCompleter) TaskCompleter(com.emc.storageos.volumecontroller.TaskCompleter) MirrorFileCreateTaskCompleter(com.emc.storageos.volumecontroller.impl.file.MirrorFileCreateTaskCompleter) WorkflowException(com.emc.storageos.workflow.WorkflowException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) ControllerException(com.emc.storageos.volumecontroller.ControllerException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Aggregations

StorageSystem (com.emc.storageos.db.client.model.StorageSystem)1 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)1 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)1 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)1 ControllerException (com.emc.storageos.volumecontroller.ControllerException)1 TaskCompleter (com.emc.storageos.volumecontroller.TaskCompleter)1 MirrorFileCreateTaskCompleter (com.emc.storageos.volumecontroller.impl.file.MirrorFileCreateTaskCompleter)1 WorkflowException (com.emc.storageos.workflow.WorkflowException)1