@Override protected void executeCommand(AdminCommandContext context, Properties extraProps) throws Exception { ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders()); List<Map<String, Object>> jobExecutions = new ArrayList<>(); extraProps.put("listBatchJobSteps", jobExecutions); for (StepExecution je : findStepExecutions()) { try { jobExecutions.add(handleJob(je, columnFormatter)); } catch (Exception ex) { logger.log(Level.WARNING, "Exception while getting jobExecution details: " + ex); logger.log(Level.FINE, "Exception while getting jobExecution details ", ex); } } context.getActionReport().setMessage(columnFormatter.toString()); }
@Override protected void executeCommand(AdminCommandContext context, Properties extraProps) throws Exception { ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders()); if (isSimpleMode()) { extraProps.put("simpleMode", true); extraProps.put("listBatchJobs", findSimpleJobInfo(columnFormatter)); } else { extraProps.put("simpleMode", false); List<Map<String, Object>> jobExecutions = new ArrayList<>(); extraProps.put("listBatchJobs", jobExecutions); for (JobExecution je : findJobExecutions()) { try { if (glassFishBatchSecurityHelper.isVisibleToThisInstance(((TaggedJobExecution) je).getTagName())) jobExecutions.add(handleJob(je, columnFormatter)); } catch (Exception ex) { logger.log(Level.WARNING, "Exception while getting jobExecution details: " + ex); logger.log(Level.FINE, "Exception while getting jobExecution details ", ex); } } } context.getActionReport().setMessage(columnFormatter.toString()); }
public static String formatBrief(List<InstanceInfo> infos) { ColumnFormatter cf = new ColumnFormatter(); for (InstanceInfo info : infos) { cf.addRow(new Object[]{ info.getName(), info.getDisplayState() }); } return cf.toString(); }
if (longOpt) { String headings[] = {"DOMAIN", "ADMIN_HOST", "ADMIN_PORT", "RUNNING", "RESTART_REQUIRED"}; ColumnFormatter cf = header ? new ColumnFormatter(headings) : new ColumnFormatter(); for (String dn : domainsList) { DomainInfo di = getStatus(dn);
cf = new ColumnFormatter(headings);
throws Exception { ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders()); List<Map<String, Object>> jobExecutions = new ArrayList<>(); extraProps.put("listBatchJobExecutions", jobExecutions);
data = je.getJobParameters() == null ? new Properties() : je.getJobParameters(); jobParamIndex = index; ColumnFormatter cf = new ColumnFormatter(new String[]{"KEY", "VALUE"}); for (Map.Entry e : ((Properties) data).entrySet()) cf.addRow(new String[]{e.getKey().toString(), e.getValue().toString()});
colfm = headerOpt ? new ColumnFormatter(getColumnHeadings(cols)) : new ColumnFormatter();
extraProps.put("listBatchRuntimeConfiguration", map); ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders()); Object[] data = new Object[getOutputHeaders().length]; for (int index=0; index<getOutputHeaders().length; index++) {
Map<String, Long> metricMap = new HashMap<>(); if (stepExecution.getMetrics() != null) { ColumnFormatter cf = new ColumnFormatter(new String[]{"METRICNAME", "VALUE"}); for (Metric metric : stepExecution.getMetrics()) { metricMap.put(metric.getType().name(), metric.getValue());
public static String format(List<InstanceInfo> infos) { String headings[] = {NAME, HOST, PORT, PID, CLUSTER, STATE}; ColumnFormatter cf = new ColumnFormatter(headings); for (InstanceInfo info : infos) { cf.addRow(new Object[]{ info.getName(), info.getHost(), info.getPort(), formatPid(info), info.getDisplayCluster(), info.getDisplayState() }); } return cf.toString(); }