private Map<String, Integer> findSimpleJobInfo(ColumnFormatter columnFormatter) throws JobSecurityException, NoSuchJobException { Map<String, Integer> jobToInstanceCountMap = new HashMap<>(); List<JobExecution> jobExecutions = findJobExecutions(); for (JobExecution je : jobExecutions) { if (glassFishBatchSecurityHelper.isVisibleToThisInstance(((TaggedJobExecution) je).getTagName())) { String jobName = je.getJobName(); int count = 0; if (jobToInstanceCountMap.containsKey(jobName)) { count = jobToInstanceCountMap.get(jobName); } jobToInstanceCountMap.put(jobName, count+1); } } for (Map.Entry<String, Integer> e : jobToInstanceCountMap.entrySet()) columnFormatter.addRow(new Object[] {e.getKey(), e.getValue()}); return jobToInstanceCountMap; }
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(); }
filename = strings.get("backup-list.unavailable"); cf.addRow(new Object[] { status.getBackupConfigName(), status.getUserName(),
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()}); st = new StringTokenizer(cf.toString(), "\n"); break; : (st.hasMoreTokens()) ? st.nextToken() : ""; columnFormatter.addRow(cfData); while (st.hasMoreTokens()) { cfData[jobParamIndex] = st.nextToken(); columnFormatter.addRow(cfData);
for (Metric metric : stepExecution.getMetrics()) { metricMap.put(metric.getType().name(), metric.getValue()); cf.addRow(new Object[] {metric.getType().name(), metric.getValue()}); : (st.hasMoreTokens() ? st.nextToken() : ""); columnFormatter.addRow(cfData); while (st.hasMoreTokens()) { cfData[stepMetricsIndex] = st.nextToken(); columnFormatter.addRow(cfData);
for (String dn : domainsList) { DomainInfo di = getStatus(dn); cf.addRow(new Object[] { dn, di.adminAddr.getHost(),
columnFormatter.addRow(data); context.getActionReport().setMessage(columnFormatter.toString());
cfData[index] = data.toString(); columnFormatter.addRow(cfData);
if (longOpt) { String data[] = getColumnData(child, cols); colfm.addRow(data); for (int i = 0; i < data.length; i++) { map.put(cols.get(i).xmlName, data[i]);
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(); }