Пример #1
0
 @Override
 public JobStatus getJobStatus(String jobId) {
   Tuple<JobDescriptor, JobStatus> tuple = getJobDescriptor(jobId);
   if (tuple == null) {
     return null;
   }
   return tuple.getY();
 }
Пример #2
0
  @Override
  public GroupBean getDownstreamGroupBean(GroupBean parent) {
    if (parent.isDirectory()) {
      List<GroupDescriptor> children = getChildrenGroup(parent.getGroupDescriptor().getId());
      for (GroupDescriptor child : children) {
        GroupBean childBean = new GroupBean(child);
        getDownstreamGroupBean(childBean);
        childBean.setParentGroupBean(parent);
        parent.getChildrenGroupBeans().add(childBean);
      }
    } else {
      List<Tuple<JobDescriptor, JobStatus>> jobs =
          getChildrenJob(parent.getGroupDescriptor().getId());
      for (Tuple<JobDescriptor, JobStatus> tuple : jobs) {
        JobBean jobBean = new JobBean(tuple.getX(), tuple.getY());
        jobBean.setGroupBean(parent);
        parent.getJobBeans().put(tuple.getX().getId(), jobBean);
      }
    }

    return parent;
  }