147148149150151152153154155
attributes.add(PrinterIsAcceptingJobs.ACCEPTING_JOBS); } int jobCount = getQueuedJobCount(serviceName); if (jobCount >= 0) { attributes.add(new QueuedJobCount(jobCount)); } return attributes; }
583584585586587588589590591592593
private QueuedJobCount getQueuedJobCount() { int count = getJobStatus(printer, 1); if (count != -1) { return new QueuedJobCount(count); } else { return new QueuedJobCount(0); } }
89909192939495
} } public static QueuedJobCount getQueuedJobCount(final long handle) throws PrintException { return new QueuedJobCount(getQueuedJobs(handle)); }
146147148149150151152153154
363364365366367368369370371372373
attrx.add(a); } } } else if (aname.equals("queued-job-count")) { for (int i = 0, ii = avalue.size(); i < ii; i++) { a = new QueuedJobCount(((Integer) avalue.get(i)).intValue()); if (a != null) { attrx.add(a); } } } else if (aname.equals("printer-state-reason")
364365366367368369370371372373374
526527528529530531532533534535536
304305306307308309310
private QueuedJobCount getQueuedJobCountSysV() { String command = "/usr/bin/lpstat -R " + printer; String results[]= UnixPrintServiceLookup.execCmd(command); int qlen = (results == null) ? 0 : results.length; return new QueuedJobCount(qlen); }