private static void runConfClient(final ProcessBuilder pb) throws Exception {
  int exitCode=-1;
  try {
    Process process=pb.start();
    exitCode=process.waitFor();
  }
 catch (  IOException e) {
    log.error("IOException: {}",e);
    exitCode=2;
    throw e;
  }
catch (  Exception e) {
    log.error("Undetermined ConfigurationClient exitCode: {}",e);
    throw e;
  }
switch (exitCode) {
case SUCCESS:
    break;
case ERROR_CODE_CANNOT_DOWNLOAD_CONF:
  throw new Exception("configuration-client error (exit code " + exitCode + "), download failed");
case ERROR_CODE_EXPIRED_CONF:
throw new Exception("configuration-client error (exit code " + exitCode + "), configuration is outdated");
case ERROR_CODE_INVALID_SIGNATURE_VALUE:
throw new Exception("configuration-client error (exit code " + exitCode + "), configuration is incorrect");
case ERROR_CODE_INTERNAL:
throw new Exception("configuration-client error (exit code " + exitCode + ")");
default :
throw new Exception("Failed to download GlobalConf " + "(configucation-client exit code " + exitCode + "), "+ "make sure configuration-client is"+ "installed correctly");
}
}

private static void runConfClient ( final ProcessBuilder pb ) throws Exception { int exitCode = - 1 ; try { Process process = pb . start ( ) ; exitCode = process . waitFor ( ) ; } catch ( IOException e ) { log . error ( "IOException: {}" , e ) ; exitCode = 2 ; throw e ; } catch ( Exception e ) { log . error ( "Undetermined ConfigurationClient exitCode: {}" , e ) ; throw e ; } switch ( exitCode ) { case SUCCESS : break ; case ERROR_CODE_CANNOT_DOWNLOAD_CONF : throw new Exception ( "configuration-client error (exit code " + exitCode + "), download failed" ) ; case ERROR_CODE_EXPIRED_CONF : throw new Exception ( "configuration-client error (exit code " + exitCode + "), configuration is outdated" ) ; case ERROR_CODE_INVALID_SIGNATURE_VALUE : throw new Exception ( "configuration-client error (exit code " + exitCode + "), configuration is incorrect" ) ; case ERROR_CODE_INTERNAL : throw new Exception ( "configuration-client error (exit code " + exitCode + ")" ) ; default : throw new Exception ( "Failed to download GlobalConf " + "(configucation-client exit code " + exitCode + "), " + "make sure configuration-client is" + "installed correctly" ) ; } }
helper method for running the configuration client script .
