如何使用AS400(JT400)客户端访问软件显示活动作业?

时间:2013-04-22 15:35:58

标签: java ibm-midrange jt400

我想开发as400客户端访问软件。我想监视磁盘空间,CPU使用情况等。和Job列表。我有工作清单。但是我想要只接受积极的工作。请帮帮我。

这是我的工作清单代码:

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);
}

1 个答案:

答案 0 :(得分:4)

 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