this.pr.errln(PrCodes.CTXPRINTSTATUS__ONE_ERROR, msg);
} else if (this.pr.useLogging()) {
logger.error(msg);
}
}
throw new ExitNow(BaseClient.APPLICATION_EXIT_CODE);
}
final Node_Type[] nodes = this.queryContextBroker();
final List<IpAndStatus> results = this.analyze(knownIps, nodes);
// if all are OK, it exits normally
boolean notAllOK = false;
String longestString = "";
for (IpAndStatus result : results) {
if (longestString.length() < result.ip.length()) {
longestString = result.ip;
}
}
final int longestStringLen = longestString.length();
for (IpAndStatus result : results) {
if (!result.status.equals(CTX_SUCCESS)) {
notAllOK = true;
}
if (this.pr.enabled()) {
final StringBuilder printIp = new StringBuilder(result.ip);
while (printIp.length() < longestStringLen) {
printIp.append(' ');
}
printIp.append(" ").append(result.status);
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CTXPRINTSTATUS__ONE_IP, printIp.toString());
} else if (this.pr.useLogging()) {
logger.info(printIp.toString());
}
}
}
if (notAllOK) {
throw new ExitNow(BaseClient.CTX_PENDING_RESULTS);
}
}