use of org.batfish.common.Task in project batfish by batfish.
the class Client method printWorkStatusResponse.
private void printWorkStatusResponse(Pair<WorkStatusCode, String> response, boolean unconditionalPrint) {
if (unconditionalPrint || _logger.getLogLevel() >= BatfishLogger.LEVEL_INFO) {
WorkStatusCode status = response.getFirst();
_logger.outputf("status: %s\n", status);
Task task;
try {
task = BatfishObjectMapper.mapper().readValue(response.getSecond(), Task.class);
} catch (IOException e) {
_logger.errorf("Could not deserialize task object: %s\n", e);
return;
}
if (task == null) {
_logger.outputf(".... no task information\n");
return;
}
List<Batch> batches = task.getBatches();
// else print all
for (int i = 0; i < batches.size(); i++) {
if (i == batches.size() - 1 || status.isTerminated()) {
_logger.outputf(".... %s\n", batches.get(i));
} else {
_logger.debugf(".... %s\n", batches.get(i));
}
}
if (status.isTerminated()) {
_logger.outputf(".... %s: %s\n", task.getTerminated(), status);
}
}
}
Aggregations