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;
}
Aggregations