protected String createFileMirrorSession(Workflow workflow,String waitFor,List<FileDescriptor> sourceDescriptors,Map<URI,FileShare> uriFileShareMap){
  for (  FileDescriptor sourceDescriptor : sourceDescriptors) {
    FileShare source=uriFileShareMap.get(sourceDescriptor.getFsURI());
    for (    String targetStr : source.getMirrorfsTargets()) {
      URI targetURI=URI.create(targetStr);
      StorageSystem system=dbClient.queryObject(StorageSystem.class,source.getStorageDevice());
      Workflow.Method createMethod=createMirrorFilePairStep(system.getId(),source.getId(),targetURI,null);
      Workflow.Method rollbackMethod=rollbackMirrorFilePairMethod(system.getId(),source.getId(),targetURI);
      waitFor=workflow.createStep(CREATE_FILE_MIRRORS_STEP,CREATE_FILE_MIRRORS_STEP_DESC,waitFor,system.getId(),system.getSystemType(),getClass(),createMethod,rollbackMethod,null);
    }
  }
  return waitFor=CREATE_FILE_MIRRORS_STEP;
}

protected String createFileMirrorSession ( Workflow workflow , String waitFor , List < FileDescriptor > sourceDescriptors , Map < URI , FileShare > uriFileShareMap ) { for ( FileDescriptor sourceDescriptor : sourceDescriptors ) { FileShare source = uriFileShareMap . get ( sourceDescriptor . getFsURI ( ) ) ; for ( String targetStr : source . getMirrorfsTargets ( ) ) { URI targetURI = URI . create ( targetStr ) ; StorageSystem system = dbClient . queryObject ( StorageSystem . class , source . getStorageDevice ( ) ) ; Workflow . Method createMethod = createMirrorFilePairStep ( system . getId ( ) , source . getId ( ) , targetURI , null ) ; Workflow . Method rollbackMethod = rollbackMirrorFilePairMethod ( system . getId ( ) , source . getId ( ) , targetURI ) ; waitFor = workflow . createStep ( CREATE_FILE_MIRRORS_STEP , CREATE_FILE_MIRRORS_STEP_DESC , waitFor , system . getId ( ) , system . getSystemType ( ) , getClass ( ) , createMethod , rollbackMethod , null ) ; } } return waitFor = CREATE_FILE_MIRRORS_STEP ; }
create mirror work flow step - creates replication session between source and target
