public static boolean isSupportedAddRPProtectionVirtualPoolChange(Volume volume,VirtualPool currentVpool,VirtualPool newVpool,DbClient dbClient,StringBuffer notSuppReasonBuff){
  s_logger.info(String.format("Checking isSupportedAddRPProtectionVirtualPoolChange from [%s] to [%s]...",currentVpool.getLabel(),newVpool.getLabel()));
  if (isSameVirtualPool(currentVpool,newVpool,notSuppReasonBuff)) {
    return false;
  }
  if (volume.checkForRp() || VirtualPool.vPoolSpecifiesProtection(currentVpool)) {
    notSuppReasonBuff.append("Can't add RecoverPoint Protection since it already exists.");
    return false;
  }
  if (!VirtualPool.vPoolSpecifiesHighAvailability(currentVpool) && VirtualPool.vPoolSpecifiesRPVPlex(newVpool)) {
    notSuppReasonBuff.append("Can't add RecoverPoint+VPLEX Protection directly to non-VPLEX volume. Import to VPLEX first.");
    return false;
  }
  if (VirtualPool.vPoolSpecifiesHighAvailability(currentVpool) && !VirtualPool.vPoolSpecifiesHighAvailabilityDistributed(currentVpool) && VirtualPool.vPoolSpecifiesMetroPoint(newVpool)) {
    notSuppReasonBuff.append("Can't add MetroPoint Protection directly to VPLEX Local volume. " + "Upgrade from VPLEX Local to VPLEX Distributed first.");
    return false;
  }
  String[] include=new String[]{TYPE,VARRAYS,REF_VPOOL,MIRROR_VPOOL,FAST_EXPANSION,ACLS,INACTIVE,PROTOCOLS,PROVISIONING_TYPE,USE_MATCHED_POOLS,ARRAY_INFO,DRIVE_TYPE,AUTO_TIER_POLICY_NAME,HOST_IO_LIMIT_IOPS,HOST_IO_LIMIT_BANDWIDTH,VMAX_COMPRESSION_ENABLED,IS_THIN_VOLUME_PRE_ALLOCATION_ENABLED,ASSIGNED_STORAGE_POOLS};
  Map<String,Change> changes=analyzeChanges(currentVpool,newVpool,include,null,null);
  if (!changes.isEmpty()) {
    notSuppReasonBuff.append("These target virtual pool differences are invalid: ");
    fillInNotSupportedReasons(changes,notSuppReasonBuff);
    return false;
  }
  include=new String[]{PROTECTION_VARRAY_SETTINGS};
  changes=analyzeChanges(currentVpool,newVpool,include,null,null);
  if (changes.isEmpty()) {
    notSuppReasonBuff.append("These target virtual pool differences are required: ");
    fillInNotSupportedReasons(changes,notSuppReasonBuff);
    return false;
  }
  if (VirtualPool.vPoolSpecifiesHighAvailability(currentVpool) && (VirtualPool.vPoolSpecifiesRPVPlex(newVpool) || VirtualPool.vPoolSpecifiesMetroPoint(newVpool))) {
    VirtualPoolChangeOperationEnum op=vplexCommonChecks(volume,currentVpool,newVpool,dbClient,notSuppReasonBuff,include);
    if (op == null || !op.equals(VirtualPoolChangeOperationEnum.RP_PROTECTED)) {
      return false;
    }
  }
  return true;
}

public static boolean isSupportedAddRPProtectionVirtualPoolChange ( Volume volume , VirtualPool currentVpool , VirtualPool newVpool , DbClient dbClient , StringBuffer notSuppReasonBuff ) { s_logger . info ( String . format ( "Checking isSupportedAddRPProtectionVirtualPoolChange from [%s] to [%s]..." , currentVpool . getLabel ( ) , newVpool . getLabel ( ) ) ) ; if ( isSameVirtualPool ( currentVpool , newVpool , notSuppReasonBuff ) ) { return false ; } if ( volume . checkForRp ( ) || VirtualPool . vPoolSpecifiesProtection ( currentVpool ) ) { notSuppReasonBuff . append ( "Can't add RecoverPoint Protection since it already exists." ) ; return false ; } if ( ! VirtualPool . vPoolSpecifiesHighAvailability ( currentVpool ) && VirtualPool . vPoolSpecifiesRPVPlex ( newVpool ) ) { notSuppReasonBuff . append ( "Can't add RecoverPoint+VPLEX Protection directly to non-VPLEX volume. Import to VPLEX first." ) ; return false ; } if ( VirtualPool . vPoolSpecifiesHighAvailability ( currentVpool ) && ! VirtualPool . vPoolSpecifiesHighAvailabilityDistributed ( currentVpool ) && VirtualPool . vPoolSpecifiesMetroPoint ( newVpool ) ) { notSuppReasonBuff . append ( "Can't add MetroPoint Protection directly to VPLEX Local volume. " + "Upgrade from VPLEX Local to VPLEX Distributed first." ) ; return false ; } String [ ] include = new String [ ] { TYPE , VARRAYS , REF_VPOOL , MIRROR_VPOOL , FAST_EXPANSION , ACLS , INACTIVE , PROTOCOLS , PROVISIONING_TYPE , USE_MATCHED_POOLS , ARRAY_INFO , DRIVE_TYPE , AUTO_TIER_POLICY_NAME , HOST_IO_LIMIT_IOPS , HOST_IO_LIMIT_BANDWIDTH , VMAX_COMPRESSION_ENABLED , IS_THIN_VOLUME_PRE_ALLOCATION_ENABLED , ASSIGNED_STORAGE_POOLS } ; Map < String , Change > changes = analyzeChanges ( currentVpool , newVpool , include , null , null ) ; if ( ! changes . isEmpty ( ) ) { notSuppReasonBuff . append ( "These target virtual pool differences are invalid: " ) ; fillInNotSupportedReasons ( changes , notSuppReasonBuff ) ; return false ; } include = new String [ ] { PROTECTION_VARRAY_SETTINGS } ; changes = analyzeChanges ( currentVpool , newVpool , include , null , null ) ; if ( changes . isEmpty ( ) ) { notSuppReasonBuff . append ( "These target virtual pool differences are required: " ) ; fillInNotSupportedReasons ( changes , notSuppReasonBuff ) ; return false ; } if ( VirtualPool . vPoolSpecifiesHighAvailability ( currentVpool ) && ( VirtualPool . vPoolSpecifiesRPVPlex ( newVpool ) || VirtualPool . vPoolSpecifiesMetroPoint ( newVpool ) ) ) { VirtualPoolChangeOperationEnum op = vplexCommonChecks ( volume , currentVpool , newVpool , dbClient , notSuppReasonBuff , include ) ; if ( op == null || ! op . equals ( VirtualPoolChangeOperationEnum . RP_PROTECTED ) ) { return false ; } } return true ; }
determines if the volume qualifies for rp protection . ( and if not , why not )
