@Override public void execute() throws Exception {
  String backCompatPreYoda=targetVdcPropInfo.getProperty(VdcConfigUtil.BACK_COMPAT_PREYODA);
  if (Boolean.valueOf(backCompatPreYoda)) {
    log.info("Set back_comp_preyoda flag to true so that ipsec can start");
    targetVdcPropInfo.addProperty(VdcConfigUtil.BACK_COMPAT_PREYODA,String.valueOf(false));
    setRollingRebootNeeded(true);
  }
  boolean bNeedFlushVdcConfigToLocal=false;
  String ipsecKeyZk=targetVdcPropInfo.getProperty(Constants.IPSEC_KEY);
  String ipsecKeyLocal=localVdcPropInfo.getProperty(Constants.IPSEC_KEY);
  if (ipsecKeyLocal == null || !ipsecKeyLocal.equals(ipsecKeyZk)) {
    log.info("Local ipsec key doesn't match with new key in zk, need to flush to local");
    bNeedFlushVdcConfigToLocal=true;
  }
  String ipsecStatusZK=targetVdcPropInfo.getProperty(Constants.IPSEC_STATUS);
  String ipsecStatusLocal=localVdcPropInfo.getProperty(Constants.IPSEC_STATUS);
  if (ipsecStatusLocal == null || !ipsecStatusLocal.equals(ipsecStatusZK)) {
    log.info("Local ipsec status doesn't match with new status in zk, need to flush to local");
    bNeedFlushVdcConfigToLocal=true;
  }
  if (bNeedFlushVdcConfigToLocal) {
    log.info("flushing ipsec related configure changes to local.");
    syncFlushVdcConfigToLocal();
  }
  refreshIPsec();
}

@ Override public void execute ( ) throws Exception { String backCompatPreYoda = targetVdcPropInfo . getProperty ( VdcConfigUtil . BACK_COMPAT_PREYODA ) ; if ( Boolean . valueOf ( backCompatPreYoda ) ) { log . info ( "Set back_comp_preyoda flag to true so that ipsec can start" ) ; targetVdcPropInfo . addProperty ( VdcConfigUtil . BACK_COMPAT_PREYODA , String . valueOf ( false ) ) ; setRollingRebootNeeded ( true ) ; } boolean bNeedFlushVdcConfigToLocal = false ; String ipsecKeyZk = targetVdcPropInfo . getProperty ( Constants . IPSEC_KEY ) ; String ipsecKeyLocal = localVdcPropInfo . getProperty ( Constants . IPSEC_KEY ) ; if ( ipsecKeyLocal == null || ! ipsecKeyLocal . equals ( ipsecKeyZk ) ) { log . info ( "Local ipsec key doesn't match with new key in zk, need to flush to local" ) ; bNeedFlushVdcConfigToLocal = true ; } String ipsecStatusZK = targetVdcPropInfo . getProperty ( Constants . IPSEC_STATUS ) ; String ipsecStatusLocal = localVdcPropInfo . getProperty ( Constants . IPSEC_STATUS ) ; if ( ipsecStatusLocal == null || ! ipsecStatusLocal . equals ( ipsecStatusZK ) ) { log . info ( "Local ipsec status doesn't match with new status in zk, need to flush to local" ) ; bNeedFlushVdcConfigToLocal = true ; } if ( bNeedFlushVdcConfigToLocal ) { log . info ( "flushing ipsec related configure changes to local." ) ; syncFlushVdcConfigToLocal ( ) ; } refreshIPsec ( ) ; }
reconfig ipsec when vdc properties ( key , ips or both ) get changed .
