Package com.taobao.zeus.store

Examples of com.taobao.zeus.store.GroupBean


    followManager.deleteFollow(LoginUser.getUser().getUid(), type, targetId);
  }

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


    }
  }

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

    return model;
  }
 
 
  public GroupModel getUpstreamGroup(String groupId) throws GwtException{
    GroupBean bean=permissionGroupManager.getUpstreamGroupBean(groupId);
    GroupDescriptor gd=bean.getGroupDescriptor();
    GroupModel model=new GroupModel();
    model.setParent(bean.getParentGroupBean()==null?null:bean.getParentGroupBean().getGroupDescriptor().getId());
    model.setLocalResources(gd.getResources());
    model.setAllResources(bean.getHierarchyResources());
    model.setLocalProperties(new HashMap<String, String>(gd.getProperties()));
    model.setDesc(gd.getDesc());
    model.setDirectory(gd.isDirectory());
    model.setId(gd.getId());
    model.setName(gd.getName());
    model.setOwner(gd.getOwner());
    String ownerName=userManager.findByUid(gd.getOwner()).getName();
    if(ownerName==null || "".equals(ownerName.trim()) || "null".equals(ownerName)){
      ownerName=gd.getOwner();
    }
    model.setOwnerName(ownerName);
    model.setParent(gd.getParent());
    model.setAllProperties(bean.getHierarchyProperties().getAllProperties());
    model.setAdmin(permissionGroupManager.hasGroupPermission(LoginUser.getUser().getUid(), groupId));
    List<ZeusFollow> follows=followManager.findGroupFollowers(Arrays.asList(groupId));
    if(follows!=null){
      List<String> followsName=new ArrayList<String>();
      for(ZeusFollow zf:follows){
        String name=userManager.findByUid(zf.getUid()).getName();
        if(name==null || "".equals(name.trim())){
          name=zf.getUid();
        }
        followsName.add(name);
      }
      model.setFollows(followsName);
    }
   
    List<String> ladmins=permissionManager.getGroupAdmins(bean.getGroupDescriptor().getId());
    List<String> admins=new ArrayList<String>();
    for(String s:ladmins){
      String name=userManager.findByUid(s).getName();
      if(name==null || "".equals(name.trim())){
        name=s;
      }
      admins.add(name);
    }
    model.setAdmins(admins);
   
    List<String> owners=new ArrayList<String>();
    owners.add(bean.getGroupDescriptor().getOwner());
    GroupBean parent=bean.getParentGroupBean();
    while(parent!=null){
      if(!owners.contains(parent.getGroupDescriptor().getOwner())){
        owners.add(parent.getGroupDescriptor().getOwner());
      }
      parent=parent.getParentGroupBean();
    }
    model.setOwners(owners);
   
    //所有secret. 开头的配置项都进行权限控制
    for(String key:model.getAllProperties().keySet()){
View Full Code Here

  public JobStatus getJobStatus(String jobId) {
    return groupManager.getJobStatus(jobId);
  }
  @Override
  public void grantGroupOwner(String granter, String uid, String groupId) throws ZeusException{
    GroupBean gb=groupManager.getUpstreamGroupBean(groupId);
    List<String> owners=new ArrayList<String>();
    while(gb!=null){
      if(!owners.contains(gb.getGroupDescriptor().getOwner())){
        owners.add(gb.getGroupDescriptor().getOwner());
      }
      gb=gb.getParentGroupBean();
    }
    if(owners.contains(granter)){
      groupManager.grantGroupOwner(granter, uid, groupId);
    }else{
      throw new ZeusException("您无权操作");
View Full Code Here

  @Override
  public void grantJobOwner(String granter, String uid, String jobId) throws ZeusException{
    JobBean jb=groupManager.getUpstreamJobBean(jobId);
    List<String> owners=new ArrayList<String>();
    owners.add(jb.getJobDescriptor().getOwner());
    GroupBean gb=jb.getGroupBean();
    while(gb!=null){
      if(!owners.contains(gb.getGroupDescriptor().getOwner())){
        owners.add(gb.getGroupDescriptor().getOwner());
      }
      gb=gb.getParentGroupBean();
    }
    if(owners.contains(granter)){
      groupManager.grantJobOwner(granter, uid, jobId);
    }else{
      throw new ZeusException("您无权操作");
View Full Code Here

    }
    jobModel.setAdmins(admins);
   
    List<String> owners=new ArrayList<String>();
    owners.add(jobBean.getJobDescriptor().getOwner());
    GroupBean parent=jobBean.getGroupBean();
    while(parent!=null){
      if(!owners.contains(parent.getGroupDescriptor().getOwner())){
        owners.add(parent.getGroupDescriptor().getOwner());
      }
      parent=parent.getParentGroupBean();
    }
    jobModel.setOwners(owners);
   
   
    //所有secret. 开头的配置项都进行权限控制
View Full Code Here

  }
  @Override
  public PagingLoadResult<JobModel> getSubJobStatus(String groupId,PagingLoadConfig config) {
    int start=config.getOffset();
    int limit=config.getLimit();
    GroupBean gb=permissionGroupManager.getDownstreamGroupBean(groupId);
    Map<String, JobBean> map=gb.getAllSubJobBeans();
   
    List<Tuple<JobDescriptor, JobStatus>> allJobs=new ArrayList<Tuple<JobDescriptor, JobStatus>>();
    for(String key:map.keySet()){
      Tuple<JobDescriptor, JobStatus> tuple=new Tuple<JobDescriptor, JobStatus>(map.get(key).getJobDescriptor(), map.get(key).getJobStatus());
      allJobs.add(tuple);
View Full Code Here

//    return result;
//  }
  @Override
  public List<JobHistoryModel> getAutoRunning(String groupId) {
    List<JobHistoryModel> result=new ArrayList<JobHistoryModel>();
    GroupBean globe=readOnlyGroupManager.getGlobeGroupBean();
    GroupBean gb=null;
    if(globe.getGroupDescriptor().getId().equals(groupId)){
      gb=globe;
    }else{
      gb=globe.getAllSubGroupBeans().get(groupId);
    }
    Map<String, JobBean> beans=gb.getAllSubJobBeans();
    List<JobStatus> jobs=new ArrayList<JobStatus>();
    for(String key:beans.keySet()){
      if(beans.get(key).getJobStatus().getStatus()==Status.RUNNING){
        jobs.add(beans.get(key).getJobStatus());
      }
    }
    List<JobHistory> hiss=new ArrayList<JobHistory>();
    for(JobStatus js:jobs){
      if(js.getHistoryId()==null){
        hiss.add(jobHistoryManager.findLastHistoryByList(Arrays.asList(js.getJobId())).get(js.getJobId()));
      }else{
        hiss.add(jobHistoryManager.findJobHistory(js.getHistoryId()));       
      }
    }
    for(JobHistory his:hiss){
      JobHistoryModel d=new JobHistoryModel();
      d.setId(his.getId());
      d.setName(gb.getAllSubJobBeans().get(his.getJobId()).getJobDescriptor().getName());
      d.setOwner(gb.getAllSubJobBeans().get(his.getJobId()).getJobDescriptor().getOwner());
      d.setJobId(his.getJobId());
      d.setStartTime(his.getStartTime());
      d.setEndTime(his.getEndTime());
      d.setExecuteHost(his.getExecuteHost());
      d.setStatus(his.getStatus()==null?null:his.getStatus().toString());
View Full Code Here

   
    return result;
  }
  @Override
  public List<JobHistoryModel> getManualRunning(String groupId) {
    GroupBean gb=null;
    GroupBean globe=readOnlyGroupManager.getGlobeGroupBeanForTreeDisplay(false);
    if(globe.getGroupDescriptor().getId().equals(groupId)){
      gb=globe;
    }else{
      gb=globe.getAllSubGroupBeans().get(groupId);
    }
    Set<String> jobs=gb.getAllSubJobBeans().keySet();
    List<JobHistory> list=jobHistoryManager.findRecentRunningHistory();
    for(Iterator<JobHistory> it=list.iterator();it.hasNext();){
      JobHistory j=it.next();
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.