private void updateVolumeLabels(Volume trustedSrc,Volume invalidTgt){
  VirtualArray invalidTgtVA=dbClient.queryObject(VirtualArray.class,invalidTgt.getVirtualArray());
  StringBuilder newLabel=new StringBuilder();
  newLabel.append(trustedSrc.getLabel());
  newLabel.append("-target-");
  newLabel.append(invalidTgtVA.getLabel());
  log.info("Revised name for target: " + newLabel.toString());
  invalidTgt.setLabel(newLabel.toString());
  NamedURI projectURI=invalidTgt.getProject();
  projectURI.setName(newLabel.toString());
  invalidTgt.setProject(projectURI);
  NamedURI tenantURI=invalidTgt.getTenant();
  tenantURI.setName(newLabel.toString());
  invalidTgt.setTenant(tenantURI);
  Volume tgtVplexVolume=VPlexSrdfUtil.getVplexVolumeFromSrdfVolume(dbClient,invalidTgt);
  if (tgtVplexVolume != null) {
    Volume srcVplexVolume=VPlexSrdfUtil.getVplexVolumeFromSrdfVolume(dbClient,trustedSrc);
    if (srcVplexVolume != null) {
      newLabel.setLength(0);
      newLabel.append(srcVplexVolume.getLabel());
      newLabel.append("-target-");
      newLabel.append(invalidTgtVA.getLabel());
      log.info("Revised name for VPlex target: " + newLabel.toString());
      tgtVplexVolume.setLabel(newLabel.toString());
      projectURI=tgtVplexVolume.getProject();
      projectURI.setName(newLabel.toString());
      tgtVplexVolume.setProject(projectURI);
      tenantURI=tgtVplexVolume.getTenant();
      tenantURI.setName(newLabel.toString());
      tgtVplexVolume.setTenant(tenantURI);
      dbClient.updateAndReindexObject(tgtVplexVolume);
    }
  }
}

private void updateVolumeLabels ( Volume trustedSrc , Volume invalidTgt ) { VirtualArray invalidTgtVA = dbClient . queryObject ( VirtualArray . class , invalidTgt . getVirtualArray ( ) ) ; StringBuilder newLabel = new StringBuilder ( ) ; newLabel . append ( trustedSrc . getLabel ( ) ) ; newLabel . append ( "-target-" ) ; newLabel . append ( invalidTgtVA . getLabel ( ) ) ; log . info ( "Revised name for target: " + newLabel . toString ( ) ) ; invalidTgt . setLabel ( newLabel . toString ( ) ) ; NamedURI projectURI = invalidTgt . getProject ( ) ; projectURI . setName ( newLabel . toString ( ) ) ; invalidTgt . setProject ( projectURI ) ; NamedURI tenantURI = invalidTgt . getTenant ( ) ; tenantURI . setName ( newLabel . toString ( ) ) ; invalidTgt . setTenant ( tenantURI ) ; Volume tgtVplexVolume = VPlexSrdfUtil . getVplexVolumeFromSrdfVolume ( dbClient , invalidTgt ) ; if ( tgtVplexVolume != null ) { Volume srcVplexVolume = VPlexSrdfUtil . getVplexVolumeFromSrdfVolume ( dbClient , trustedSrc ) ; if ( srcVplexVolume != null ) { newLabel . setLength ( 0 ) ; newLabel . append ( srcVplexVolume . getLabel ( ) ) ; newLabel . append ( "-target-" ) ; newLabel . append ( invalidTgtVA . getLabel ( ) ) ; log . info ( "Revised name for VPlex target: " + newLabel . toString ( ) ) ; tgtVplexVolume . setLabel ( newLabel . toString ( ) ) ; projectURI = tgtVplexVolume . getProject ( ) ; projectURI . setName ( newLabel . toString ( ) ) ; tgtVplexVolume . setProject ( projectURI ) ; tenantURI = tgtVplexVolume . getTenant ( ) ; tenantURI . setName ( newLabel . toString ( ) ) ; tgtVplexVolume . setTenant ( tenantURI ) ; dbClient . updateAndReindexObject ( tgtVplexVolume ) ; } } }
updates the label field of the invalidtgt , and if the volume is fronted by a vplex volume , also updates the target vplex volume label .
