public static class StatusUpdateJob implements Job<StatusResponse> {
@SuppressWarnings("unchecked")
public StatusResponse run(ProgressMonitor monitor) throws Exception {
monitor.setTotalSteps(1 + 1 + 5 /* connection + status + queues*/);
HylaFAXClient client = JHylaFAX.getInstance().getConnection(monitor);
monitor.work(1);
StatusResponse response = new StatusResponse();
monitor.setText(i18n.tr("Getting Status"));
List<String> lines = client.getList("status");
StringBuffer sb = new StringBuffer();
for (Iterator<String> it = lines.iterator(); it.hasNext();) {
String line = it.next();
if (response.status == null) {
response.status = line;
}
sb.append(line + "\n");
}
response.verboseStatus = sb.toString();
monitor.work(1);
client.jobfmt(HylaFAXClientHelper.JOBFMT);
client.rcvfmt(HylaFAXClientHelper.RCVFMT);
client.filefmt(HylaFAXClientHelper.FILEFMT);
response.recvq = getQueue(monitor, client, "recvq", ReceivedFax.class);
response.sendq = getQueue(monitor, client, "sendq", FaxJob.class);
response.pollq = getQueue(monitor, client, "pollq", FaxJob.class);
response.doneq = getQueue(monitor, client, "doneq", FaxJob.class);