Examples of HashSet


Examples of java.util.HashSet

                Object param = getter.getValue().invoke(obj);

                if (getter.getValue().getReturnType().isArray()) {
                    param = ((Object[]) param).clone();
                } else if (Collection.class.isAssignableFrom(getter.getValue().getReturnType())) {
                    param = new HashSet((Collection) param);
                } else if (Map.class.isAssignableFrom(getter.getValue().getReturnType())) {
                    param = new HashMap((Map) param);
                }

                setter.invoke(newObj, param);
View Full Code Here

Examples of java.util.HashSet

public class ImportHandler extends BaseAbstractHandler implements Handler {

  public ImportHandler() {
    if ((this.validParents == null) && (this.validPeers == null)) {
      this.validParents = new HashSet();
      this.validParents.add(Process.class);

      this.validPeers = new HashSet();
      this.validPeers.add(null);

      this.allowNesting = false;
    }
  }
View Full Code Here

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

Examples of java.util.HashSet

      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

Examples of java.util.HashSet

      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

Examples of java.util.HashSet

      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

Examples of java.util.HashSet

      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

Examples of java.util.HashSet

         // 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

Examples of java.util.HashSet

      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

Examples of java.util.HashSet

        return connection;
  }
     
  public synchronized void addConnectionEventListener(ConnectionEventListener listener){
    if(listeners == null){
      listeners = new HashSet();
    }
    this.listeners.add(listener);
  }
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.