Package java.util

Examples of java.util.HashSet


   }

   public Collection removeMembershipByUser(String userName, boolean broadcast) throws Exception
   {

      Collection<Role> roles = new HashSet();

      try
      {
         roles = getIdentitySession().getRoleManager().findRoles(userName, null);
      }
      catch (Exception e)
      {
         //TODO:
         log.info("Identity operation error: ", e);

      }

      HashSet<MembershipImpl> memberships = new HashSet<MembershipImpl>();

      for (Role role : roles)
      {
         MembershipImpl m = new MembershipImpl();
         Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
         m.setGroupId(g.getId());
         m.setUserName(role.getUser().getId());
         m.setMembershipType(role.getRoleType().getName());
         memberships.add(m);

         if (broadcast)
         {
            preDelete(m);
         }

         getIdentitySession().getRoleManager().removeRole(role);

         if (broadcast)
         {
            postDelete(m);
         }

      }

      if (isAssociationMapped())
      {

         Collection<org.picketlink.idm.api.Group> groups = new HashSet();

         try
         {
            groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
         }
View Full Code Here


      String gid =
         getIdentitySession().getPersistenceManager().
            createGroupKey(plGroupName, getGroupTypeFromId(groupId));

      Collection<RoleType> roleTypes = new HashSet();

      try
      {
         roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
      }
View Full Code Here

      return new LinkedList(memberships);
   }

   public Collection findMembershipsByUser(String userName) throws Exception
   {
      Collection<Role> roles = new HashSet();

      try
      {
         roles = getIdentitySession().getRoleManager().findRoles(userName, null);
      }
      catch (Exception e)
      {
         //TODO:
         log.info("Identity operation error: ", e);

      }

      HashSet<MembershipImpl> memberships = new HashSet<MembershipImpl>();

      for (Role role : roles)
      {
         if (isCreateMembership(role.getRoleType().getName()))
         {
            MembershipImpl m = new MembershipImpl();
            Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
            m.setGroupId(g.getId());
            m.setUserName(role.getUser().getId());
            m.setMembershipType(role.getRoleType().getName());
            memberships.add(m);
         }
      }
     
      if (isAssociationMapped())
      {

         Collection<org.picketlink.idm.api.Group> groups = new HashSet();

         try
         {
            groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
         }
View Full Code Here

      String gid =
         getIdentitySession().getPersistenceManager().createGroupKey(plGroupName,
            getGroupTypeFromId(groupId));

      Collection<Role> roles = new HashSet();

      try
      {
         roles = getIdentitySession().getRoleManager().findRoles(gid, null);
      }
      catch (Exception e)
      {
         //TODO:
         log.info("Identity operation error: ", e);

      }

      HashSet<MembershipImpl> memberships = new HashSet<MembershipImpl>();

      for (Role role : roles)
      {
         if (isCreateMembership(role.getRoleType().getName()))
         {
            MembershipImpl m = new MembershipImpl();
            Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
            m.setGroupId(g.getId());
            m.setUserName(role.getUser().getId());
            m.setMembershipType(role.getRoleType().getName());
            memberships.add(m);
         }
      }

      if (isAssociationMapped())
      {

         Collection<org.picketlink.idm.api.User> users = new HashSet();

         try
         {
            users = getIdentitySession().getRelationshipManager().findAssociatedUsers(gid, false, null);
         }
View Full Code Here

      return group;
   }

   public Collection findGroupByMembership(String userName, String membershipType) throws Exception
   {
      Collection<org.picketlink.idm.api.Role> allRoles = new HashSet();

      try
      {
         allRoles = getIdentitySession().getRoleManager().findRoles(userName, membershipType);
      }
      catch (Exception e)
      {
         log.info("Identity operation error: ", e);
      }

      Set<Group> exoGroups = new HashSet<Group>();

      MembershipDAOImpl mmm = (MembershipDAOImpl)orgService.getMembershipHandler();

      for (org.picketlink.idm.api.Role role : allRoles)
      {
         if (mmm.isCreateMembership(role.getRoleType().getName()))                           
         {
            exoGroups.add(convertGroup(role.getGroup()));
         }
      }

      if (mmm.isAssociationMapped() && mmm.getAssociationMapping().equals(membershipType))
      {
         Collection<org.picketlink.idm.api.Group> groups = new HashSet();

         try
         {
            groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
         }
View Full Code Here

         // at org.exoplatform.organization.webui.component.GroupManagement.isAdministrator(GroupManagement.java:125)
         // at org.exoplatform.organization.webui.component.UIGroupExplorer.<init>(UIGroupExplorer.java:57)
         return Collections.emptyList();
      }

      Collection<org.picketlink.idm.api.Group> allGroups = new HashSet();

      try
      {
         allGroups = getIdentitySession().getRelationshipManager().findRelatedGroups(user, null, null);
      }
View Full Code Here

      if (jbidGroup.equals(getRootGroup()))
      {
         return "";
      }

      Collection<org.picketlink.idm.api.Group> parents = new HashSet();

      String gtnGroupName = getGtnGroupName(jbidGroup.getName());

      try
      {
         parents = getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, null, false, false);
      }
      catch (Exception e)
      {
         //TODO:
         log.info("Identity operation error: ", e);
      }


      if (parents.size() == 0 || parents.size() > 1)
      {

         if (parents.size() > 1)
         {
            log.info("PLIDM Group has more than one parent: " + jbidGroup.getName() + "; Will try to use parent path " +
               "defined by type mappings or just place it under root /");
         }


         String id = orgService.getConfiguration().getParentId(jbidGroup.getGroupType());



         if (id != null && orgService.getConfiguration().isForceMembershipOfMappedTypes())
         {
            if (id.endsWith("/*"))
            {
               id = id.substring(0, id.length() - 2);
            }

            return id + "/" + gtnGroupName;
         }


         // All groups not connected to the root should be just below the root
         return "/" + gtnGroupName;

         //TODO: make it configurable
         // throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());

      }

      String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()));

      return parentGroupId + "/" + gtnGroupName;

   }
View Full Code Here

        return connection;
  }
     
  public synchronized void addConnectionEventListener(ConnectionEventListener listener){
    if(listeners == null){
      listeners = new HashSet();
    }
    this.listeners.add(listener);
  }
View Full Code Here

                atLeastOneFits = true;
            }

//          compose cells array list for subsequent code
            cells.clear();
            Set opt = new HashSet();
            iterator = rows.iterator();
            while (iterator.hasNext()) {
                ArrayList row = (ArrayList) iterator.next();
               
                Iterator cellIterator = row.iterator();
                while (cellIterator.hasNext()) {
                    cell = (PdfCell) cellIterator.next();
                   
                    if (!opt.contains(cell)) {
                        cells.add(cell);
                        opt.add(cell);
                    }
                }
            }
           
      // we paint the graphics of the table after looping through all the cells
View Full Code Here

    this.config = config;
  }

  @Override
  public Set<K> keys() {
    HashSet keys = new HashSet();
    Node<K, V> node = getRootNode();
    Set<Node<K, V>> children = node.getChildren();
    for (Node<K, V> child:children) {
      keys.addAll(child.getData().keySet());
    }
    return keys;
  }
View Full Code Here

TOP

Related Classes of java.util.HashSet

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.