Package com.taobao.zeus.store

Examples of com.taobao.zeus.store.GroupBean


  @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){
View Full Code Here


    if(Super.getSupers().contains(user)){
      //超级管理员
      return true;
    }
    Set<String> groups=new HashSet<String>();
    GroupBean gb=groupManager.getUpstreamGroupBean(groupId);
    if(user.equals(gb.getGroupDescriptor().getOwner())){
      //组所有人
      return true;
    }
    while(gb!=null){
      groups.add(gb.getGroupDescriptor().getId());
      gb=gb.getParentGroupBean();
    }
    Set<String> users=new HashSet<String>();
    for(String g:groups){
      users.addAll(getGroupAdmins(g));
    }
View Full Code Here

    JobBean jobBean=groupManager.getUpstreamJobBean(jobId);
    if(user.equals(jobBean.getJobDescriptor().getOwner())){
      //任务所有人
      return true;
    }
    GroupBean gb=jobBean.getGroupBean();
    while(gb!=null){
      groups.add(gb.getGroupDescriptor().getId());
      gb=gb.getParentGroupBean();
    }
    Set<String> users=new HashSet<String>();
    users.addAll(getJobAdmins(jobId));
    for(String g:groups){
      users.addAll(getGroupAdmins(g));
View Full Code Here

      if(mvce.getAppEvent() instanceof JobFailedEvent){
        final JobFailedEvent event=(JobFailedEvent) mvce.getAppEvent();
        final String jobId=event.getJobId();
        final String causeJobId=event.getJobException().getCauseJobId();
        if(chainLocal.get()==null || !chainLocal.get().getCauseJobId().equals(causeJobId)){
          GroupBean gb=readOnlyGroupManager.getGlobeGroupBean();
          chainLocal.set(new ChainException(causeJobId, gb));
        }
        final ChainException chain=chainLocal.get();
        final JobBean jobBean=chain.gb.getAllSubJobBeans().get(jobId);
        final ZeusUser owner=userManager.findByUid(jobBean.getJobDescriptor().getOwner());
View Full Code Here

  @SuppressWarnings("unchecked")
  private boolean isJobsAndGroupsChangedIgnoreContent(){
    //init
    final Judge ignoreContentJobJudge=this.ignoreContentJobJudge;
    final Judge ignoreContentGroupJudge=this.ignoreContentGroupJudge;
    final GroupBean ignoreGlobe=this.ignoreGlobe;
   
    boolean jobChanged;
    Judge jobrealtime=null;
    jobrealtime=(Judge) getHibernateTemplate().execute(new HibernateCallback() {
      @Override
View Full Code Here

   * @return
   */
  private boolean isAllGroupsNotChangeParent(GroupBean gb,List<GroupDescriptor> list){
    Map<String, GroupBean> allGroups=gb.getAllSubGroupBeans();
    for(GroupDescriptor gd:list){
      GroupBean bean=allGroups.get(gd.getId());
      if(gd.getId().equals(gb.getGroupDescriptor().getId())){
        break;
      }
      if(bean==null){
        DebugInfoLog.info("isAllGroupsNotChangeParent group id="+ gd.getId()+" has changed");
        return false;
      }
      GroupDescriptor old=bean.getGroupDescriptor();
      if(!old.getParent().equals(gd.getParent())){
        DebugInfoLog.info("isAllGroupsNotChangeParent group id="+ gd.getId()+" has changed");
        return false;
      }
    }
View Full Code Here

      return ignoreGlobe;
    }
  }
 
  public GroupBean getCopyGlobeGroupBean(){
    GroupBean gb=getGlobeGroupBean();
    return GroupManagerTool.buildGlobeGroupBean(new CopyGroupManagerAssembly(gb));
  }
View Full Code Here

 
  private static Logger log=LoggerFactory.getLogger(TreeServiceImpl.class);
  @Override
  public GroupJobTreeModel getMyTreeData() {
    String uid=LoginUser.getUser().getUid();
    GroupBean rootGroup=readOnlyGroupManager.getGlobeGroupBeanForTreeDisplay(true);
    Map<String, JobBean> allJobs=rootGroup.getAllSubJobBeans();
    for(String key:allJobs.keySet()){
      JobBean bean=allJobs.get(key);
      //不是owner,删除
      if(!bean.getJobDescriptor().getOwner().equals(uid)){
        bean.getGroupBean().getJobBeans().remove(key);
      }
    }
   
    Map<String, GroupBean> allGroups=rootGroup.getAllSubGroupBeans();
    List<GroupBean> leafGroups=new ArrayList<GroupBean>();
    for(GroupBean bean:allGroups.values()){
      if(!bean.isDirectory() || bean.getChildrenGroupBeans().isEmpty()){
        leafGroups.add(bean);
      }
View Full Code Here

    return getTreeData(rootGroup);
  }
  private void recursionRemove(GroupBean bean,String uid){
    if(!bean.isDirectory()){
      if(!bean.getGroupDescriptor().getOwner().equals(uid) && bean.getJobBeans().isEmpty()){
        GroupBean parent=bean.getParentGroupBean();
        if(parent!=null){
          parent.getChildrenGroupBeans().remove(bean);
          recursionRemove(parent, uid);
        }
      }
    }else{
      if(!bean.getGroupDescriptor().getOwner().equals(uid) && bean.getChildrenGroupBeans().isEmpty()){
        GroupBean parent=bean.getParentGroupBean();
        if(parent!=null){
          parent.getChildrenGroupBeans().remove(bean);
          recursionRemove(parent, uid);
        }
      }
    }
  }
View Full Code Here

      }
    }
  }
  @Override
  public GroupJobTreeModel getTreeData() {
    GroupBean globe=null;
    globe=readOnlyGroupManager.getGlobeGroupBeanForTreeDisplay(false);
    return getTreeData(globe);
  }
View Full Code Here

TOP

Related Classes of com.taobao.zeus.store.GroupBean

Copyright © 2018 www.massapicom. 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.