INFO_TASKINFO_FIELD_NOTIFY_ON_ERROR.get(),
taskEntry.getErrorNotificationEmailAddresses(),
INFO_TASKINFO_NONE_SPECIFIED.get());
StringWriter sw = new StringWriter();
TextTablePrinter tablePrinter = new TextTablePrinter(sw);
tablePrinter.setTotalWidth(80);
tablePrinter.setIndentWidth(INDENT);
tablePrinter.setColumnWidth(1, 0);
table.print(tablePrinter);
app.getOutputStream().println();
app.getOutputStream().println(Message.raw(sw.getBuffer().toString()));
// Create a table for the task options
table = new TableBuilder();
table.appendHeading(INFO_TASKINFO_OPTIONS.get(taskEntry.getType()));
Map<Message,List<String>> taskSpecificAttrs =
taskEntry.getTaskSpecificAttributeValuePairs();
for (Message attrName : taskSpecificAttrs.keySet()) {
table.startRow();
table.appendCell(attrName);
List<String> values = taskSpecificAttrs.get(attrName);
if (values.size() > 0) {
table.appendCell(values.get(0));
}
if (values.size() > 1) {
for (int i = 1; i < values.size(); i++) {
table.startRow();
table.appendCell();
table.appendCell(values.get(i));
}
}
}
sw = new StringWriter();
tablePrinter = new TextTablePrinter(sw);
tablePrinter.setTotalWidth(80);
tablePrinter.setIndentWidth(INDENT);
tablePrinter.setColumnWidth(1, 0);
table.print(tablePrinter);
app.getOutputStream().println(Message.raw(sw.getBuffer().toString()));
// Print the last log message if any
List<Message> logs = taskEntry.getLogMessages();
if (logs != null && logs.size() > 0) {
// Create a table for the last log entry
table = new TableBuilder();
table.appendHeading(INFO_TASKINFO_FIELD_LAST_LOG.get());
table.startRow();
table.appendCell(logs.get(logs.size() - 1));
sw = new StringWriter();
tablePrinter = new TextTablePrinter(sw);
tablePrinter.setTotalWidth(80);
tablePrinter.setIndentWidth(INDENT);
tablePrinter.setColumnWidth(0, 0);
table.print(tablePrinter);
app.getOutputStream().println(Message.raw(sw.getBuffer().toString()));
}
app.getOutputStream().println();