Package com.taobao.zeus.model

Examples of com.taobao.zeus.model.GroupDescriptor


  public static GroupBean buildGlobeGroupBeanWithoutDepend(GroupManager groupManager) {
    GroupBean root=groupManager.getDownstreamGroupBean(groupManager.getRootGroupId());
    return root;
  }
  public static GroupBean getDownstreamGroupBean(String groupId,GroupManager groupManager) {
    GroupDescriptor group=groupManager.getGroupDescriptor(groupId);
    GroupBean result=new GroupBean(group);
    return groupManager.getDownstreamGroupBean(result);
  }
View Full Code Here


      }
      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;
      }
    }
    return true;
View Full Code Here

  private PermissionManager permissionManager;
  @Override
  public String createGroup(String groupName, String parentGroupId,
      boolean isDirectory) throws GwtException {
    try {
      GroupDescriptor gd=permissionGroupManager.createGroup(LoginUser.getUser().getUid(), groupName, parentGroupId, isDirectory);
      return gd.getId();
    } catch (ZeusException e) {
      throw new GwtException(e.getMessage());
    }
  }
View Full Code Here

    }
  }

  @Override
  public GroupModel getGroup(String groupId) throws GwtException {
    GroupDescriptor gd=permissionGroupManager.getGroupDescriptor(groupId);
    GroupModel model=new GroupModel();
    model.setLocalResources(gd.getResources());
    model.setLocalProperties(gd.getProperties());
    model.setDesc(gd.getDesc());
    model.setDirectory(gd.isDirectory());
    model.setId(gd.getId());
    model.setName(gd.getName());
    model.setOwner(gd.getOwner());
    model.setParent(gd.getParent());
    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){
View Full Code Here

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



  @Override
  public void updateGroup(GroupModel group) throws GwtException {
    GroupDescriptor gd=new GroupDescriptor();
    gd.setResources(group.getLocalResources());
    gd.setDesc(group.getDesc());
    gd.setId(group.getId());
    gd.setName(group.getName());
    gd.setProperties(group.getLocalProperties());
   
   
    try {
      permissionGroupManager.updateGroup(LoginUser.getUser().getUid(), gd);
    } catch (ZeusException e) {
View Full Code Here

  }

  @Override
  public void deleteGroup(String user, String groupId) throws ZeusException {
    if(hasGroupPermission(user, groupId)){
      GroupDescriptor gd=groupManager.getGroupDescriptor(groupId);
      if(gd!=null && gd.getOwner().equals(user)){
        groupManager.deleteGroup(user, groupId);
      }
    }else{
      throw new ZeusException("您无权操作");
    }
View Full Code Here

  @Override
  public void updateGroup(String user, GroupDescriptor group)
      throws ZeusException {
    if(hasGroupPermission(user, group.getId())){
      GroupDescriptor gd=groupManager.getGroupDescriptor(group.getId());
      if(gd!=null){
        groupManager.updateGroup(user, group);
      }
    }else{
      throw new ZeusException("没有更新的权限");
View Full Code Here

TOP

Related Classes of com.taobao.zeus.model.GroupDescriptor

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.