public IPsecStatus checkStatus(){
  log.info("Checking ipsec status ...");
  IPsecStatus status=new IPsecStatus();
  String vdcConfigVersion=loadVdcConfigVersionFromZK();
  status.setVersion(vdcConfigVersion);
  String ipsecKeyUpdatedTime=ipsecConfig.getIpsecKeyUpdatedTime();
  String ipsecStatus=ipsecConfig.getIpsecStatus();
  if (ipsecStatus != null && ipsecStatus.equals(STATUS_DISABLED)) {
    status.setStatus(ipsecStatus);
  }
 else {
    List<String> disconnectedNodes=checkIPsecStatus();
    if (CollectionUtils.isEmpty(disconnectedNodes)) {
      status.setStatus(STATUS_GOOD);
    }
 else {
      status.setStatus(STATUS_DEGRADED);
      status.setDisconnectedNodes(disconnectedNodes);
    }
    if (ipsecKeyUpdatedTime == null) {
      ipsecKeyUpdatedTime=vdcConfigVersion;
    }
    status.setUpdatedTime(ipsecKeyUpdatedTime);
  }
  return status;
}

public IPsecStatus checkStatus ( ) { log . info ( "Checking ipsec status ..." ) ; IPsecStatus status = new IPsecStatus ( ) ; String vdcConfigVersion = loadVdcConfigVersionFromZK ( ) ; status . setVersion ( vdcConfigVersion ) ; String ipsecKeyUpdatedTime = ipsecConfig . getIpsecKeyUpdatedTime ( ) ; String ipsecStatus = ipsecConfig . getIpsecStatus ( ) ; if ( ipsecStatus != null && ipsecStatus . equals ( STATUS_DISABLED ) ) { status . setStatus ( ipsecStatus ) ; } else { List < String > disconnectedNodes = checkIPsecStatus ( ) ; if ( CollectionUtils . isEmpty ( disconnectedNodes ) ) { status . setStatus ( STATUS_GOOD ) ; } else { status . setStatus ( STATUS_DEGRADED ) ; status . setDisconnectedNodes ( disconnectedNodes ) ; } if ( ipsecKeyUpdatedTime == null ) { ipsecKeyUpdatedTime = vdcConfigVersion ; } status . setUpdatedTime ( ipsecKeyUpdatedTime ) ; } return status ; }
checking ipsec status against the entire system .
