我想开发as400客户端访问软件。我要监视磁盘空间,cpu使用情况等。以及作业列表。我有工作清单。但是我只想从事现役。请帮我。
这是我的工作清单代码:
try {
AS400 system = new AS400 ("SERVER","USER", "PASS");
JobList jobList = new JobList(system);
Enumeration list = jobList.getJobs();
while (list.hasMoreElements()) {
Job j= (Job) list.nextElement();
String GCPU = Integer.toString(j.getCPUUsed());
System.out.println("Name " + j.getName() + " | Job NO : " + j.getNumber() + " | User : " + j.getUser() + " | CPU USED : " + j.getCPUUsed());
// System.out.println("Date Entered : " + j.getDate() + " | Status : " + j.getStatus() + " | Type : " + j.getType());
}
} catch (Exception e) {
System.out.println(e);
}
最佳答案
JobList jobList = new JobList(system);
jobList.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_ACTIVE, Boolean.TRUE);
jobList.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_JOBQ, Boolean.FALSE);
jobList.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_OUTQ, Boolean.FALSE);
Enumeration jobs = jobList.getJobs();
即使关闭并重新使用此JobList,作业选择标准列表也会在内部维护。要以一组新的作业选择标准重新开始,请调用clearJobSelectionCriteria()。
有关更多详细信息,请参见Javadoc。