Examples of GroupJobTreeModel


Examples of com.taobao.zeus.web.platform.client.module.jobmanager.GroupJobTreeModel

      }else if(ZeusFollow.JobType.equals(f.getType())){
        jobFollow.put(f.getTargetId(), true);
      }
    }
   
    GroupJobTreeModel root=new GroupJobTreeModel();
    root.setName(rootGroup.getGroupDescriptor().getName());
    root.setId(rootGroup.getGroupDescriptor().getId());
    root.setGroup(true);
    root.setDirectory(true);
    root.setJob(false);
    root.setOwner(rootGroup.getGroupDescriptor().getOwner());
    Boolean isFollow=groupFollow.get(rootGroup.getGroupDescriptor().getId());
    root.setFollow(isFollow==null?false:isFollow);
   
   
   
    setGroup(root,rootGroup.getChildrenGroupBeans(),groupFollow,jobFollow);
   
View Full Code Here

Examples of com.taobao.zeus.web.platform.client.module.jobmanager.GroupJobTreeModel

      public int compare(GroupBean o1, GroupBean o2) {
        return o1.getGroupDescriptor().getName().compareToIgnoreCase(o2.getGroupDescriptor().getName());
      }
    });
    for(GroupBean g:children){
      GroupJobTreeModel group=new GroupJobTreeModel();
      group.setName(g.getGroupDescriptor().getName());
      group.setId(g.getGroupDescriptor().getId());
      group.setGroup(true);
      group.setJob(false);
      group.setOwner(g.getGroupDescriptor().getOwner());
      group.setDirectory(g.isDirectory());
      Boolean follow=groupFollow.get(g.getGroupDescriptor().getId());
      group.setFollow(follow==null?false:(follow?true:false));
      parent.getChildren().add(group);
      if(g.isDirectory()){
        setGroup(group,g.getChildrenGroupBeans(),groupFollow,jobFollow);
      }else{
        List<JobBean> list=new ArrayList<JobBean>();
        for(JobBean jb:g.getJobBeans().values()){
          list.add(jb);
        }
        Collections.sort(list, new Comparator<JobBean>() {
          public int compare(JobBean o1, JobBean o2) {
            return o1.getJobDescriptor().getName().compareTo(o2.getJobDescriptor().getName());
          }
        });
        for(JobBean jb:list){
          GroupJobTreeModel job=new GroupJobTreeModel();
          job.setId(jb.getJobDescriptor().getId());
          job.setGroup(false);
          job.setDirectory(false);
          job.setName(jb.getJobDescriptor().getName());
          job.setJob(true);
          Boolean jFollow=jobFollow.get(job.getId());
          job.setFollow(jFollow==null?false:(jFollow?true:false));
          group.getChildren().add(job);
        }
      }
     
    }
View Full Code Here

Examples of com.taobao.zeus.web.platform.client.module.jobmanager.GroupJobTreeModel

  @Override
  public GroupJobTreeModel getDependeeTree(String jobId) {
    GroupBean globe=readOnlyGroupManager.getGlobeGroupBean();
    JobBean jb=globe.getAllSubJobBeans().get(jobId);
    if(jb!=null){
      GroupJobTreeModel root=new GroupJobTreeModel();
      root.setName(jb.getJobDescriptor().getName());
      root.setId(jb.getJobDescriptor().getId());
      root.setGroup(false);
      root.setDirectory(jb.getDependee().isEmpty()?false:true);
      root.setJob(true);
      root.setOwner(jb.getJobDescriptor().getOwner());
     
      setJob(root,jb.getDependee(),true);
      return root;
    }
    return null;
View Full Code Here

Examples of com.taobao.zeus.web.platform.client.module.jobmanager.GroupJobTreeModel

    }
    return null;
  }
  private void setJob(GroupJobTreeModel parent,Collection<JobBean> children,boolean dependee){
    for(JobBean g:children){
      GroupJobTreeModel job=new GroupJobTreeModel();
      job.setName(g.getJobDescriptor().getName());
      job.setId(g.getJobDescriptor().getId());
      job.setGroup(false);
      job.setJob(true);
      job.setOwner(g.getJobDescriptor().getOwner());
      Boolean dir=false;
      Collection<JobBean> childs=null;
      if(dependee){
        dir=g.getDependee().isEmpty()?false:true;
        childs=g.getDependee();
      }else{
        dir=g.getDepender().isEmpty()?false:true;
        childs=g.getDepender();
      }
      job.setDirectory(dir);
      parent.getChildren().add(job);
      if(!childs.isEmpty()){
        setJob(job,childs,dependee);
      }
    }
View Full Code Here

Examples of com.taobao.zeus.web.platform.client.module.jobmanager.GroupJobTreeModel

  @Override
  public GroupJobTreeModel getDependerTree(String jobId) {
    GroupBean globe=readOnlyGroupManager.getGlobeGroupBean();
    JobBean jb=globe.getAllSubJobBeans().get(jobId);
    if(jb!=null){
      GroupJobTreeModel root=new GroupJobTreeModel();
      root.setName(jb.getJobDescriptor().getName());
      root.setId(jb.getJobDescriptor().getId());
      root.setGroup(false);
      root.setDirectory(jb.getDepender().isEmpty()?false:true);
      root.setJob(true);
      root.setOwner(jb.getJobDescriptor().getOwner());
     
      setJob(root,jb.getDepender(),false);
      return root;
    }
    return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.