Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IEntityGroup


   throws GroupsException {
       if ( ! groupDef.contains(person) )
           { return false;}
       else
       {
           IEntityGroup group = cacheGet(groupDef.getKey());
           IEntityGroup parentGroup = null;
           Set<IEntityGroup> allParents = primGetAllContainingGroups(group, new HashSet<IEntityGroup>());
           boolean testPassed = true;
           for (Iterator<IEntityGroup> i=allParents.iterator(); i.hasNext() && testPassed;)
           {
               parentGroup = i.next();
               GroupDefinition parentGroupDef =
                 (GroupDefinition) groupDefinitions.get(parentGroup.getLocalKey());
               testPassed = parentGroupDef.test(person);              
           }
          
           if (!testPassed && log.isWarnEnabled()) {
               StringBuffer sb = new StringBuffer();
               sb.append("PAGS group=").append(group.getKey());
               sb.append(" contained person=").append(member.getKey());
               sb.append(", but the person failed to be contained in ");
               sb.append("ancesters of this group");
               sb.append((parentGroup != null ? " (parentGroup="+parentGroup.getKey()+")" : ""));
               sb.append(". This may indicate a ");
               sb.append("misconfigured PAGS group ");
               sb.append("store. Please check PAGSGroupStoreConfig.xml.");
               log.warn(sb.toString());
           }
View Full Code Here


   throws GroupsException
   {
       Iterator i = findContainingGroups(group);
       while ( i.hasNext() )
       {
           IEntityGroup parentGroup = (IEntityGroup) i.next();
           s.add(parentGroup);
           primGetAllContainingGroups(parentGroup, s);
       }
       return s;
   }
View Full Code Here

   }
   private Iterator<IEntityGroup> findContainingGroupsForEntity(IEntity member)
   throws GroupsException {
       List<IEntityGroup> results = new ArrayList<IEntityGroup>();
       for (Iterator<IEntityGroup> i = groups.values().iterator(); i.hasNext(); ) {
          IEntityGroup group = i.next();
          if ( contains(group, member))
              { results.add(group); }
       }
       return results.iterator();
   }
View Full Code Here

          { return EMPTY_SEARCH_RESULTS; }
      List<EntityIdentifier> results = new ArrayList<EntityIdentifier>();
      switch (method) {
         case IS:
            for (Iterator<IEntityGroup> i = groups.values().iterator(); i.hasNext(); ) {
               IEntityGroup g = i.next();
               if (g.getName().equalsIgnoreCase(query)) {
                  results.add(g.getEntityIdentifier());
               }
            }
            break;
         case STARTS_WITH:
            for (Iterator<IEntityGroup> i = groups.values().iterator(); i.hasNext(); ) {
               IEntityGroup g = i.next();
               if (g.getName().toUpperCase().startsWith(query.toUpperCase())) {
                  results.add(g.getEntityIdentifier());
               }
            }
            break;
         case ENDS_WITH:
            for (Iterator<IEntityGroup> i = groups.values().iterator(); i.hasNext(); ) {
               IEntityGroup g = i.next();
               if (g.getName().toUpperCase().endsWith(query.toUpperCase())) {
                  results.add(g.getEntityIdentifier());
              }
            }
            break;
         case CONTAINS:
            for (Iterator<IEntityGroup> i = groups.values().iterator(); i.hasNext(); ) {
               IEntityGroup g = i.next();
               if (g.getName().toUpperCase().indexOf(query.toUpperCase()) != -1) {
                  results.add(g.getEntityIdentifier());
              }
            }
            break;
      }
      return results.toArray(new EntityIdentifier[]{});
View Full Code Here

    catch ( GroupsException ge )
        { throw new AuthorizationException("Could not retrieve Groups for " + principal,ge) ; }

    while ( i.hasNext() )
    {
        IEntityGroup group = (IEntityGroup) i.next();
        IAuthorizationPrincipal p = getPrincipalForGroup(group);
        al.add(p);
    }
    return al.iterator();
}
View Full Code Here

      public boolean isApplicable(IPerson p)
      {
          if (groupKey == null || p == null)
              return false;
         
          IEntityGroup group = getGroup(groupKey);
          EntityIdentifier ei = p.getEntityIdentifier();
         
          try
          {
              IGroupMember groupMember = GroupService.getGroupMember(ei);
View Full Code Here

    try {
     
      String key = (String) attr.get(keyAttributeName).get();
      String groupName = (String) attr.get(groupNameAttributeName).get();
           
      IEntityGroup g = new EntityTestingGroupImpl(key, IPerson.class);
          g.setCreatorID("System");
          g.setName(groupName);
          g.setDescription(GROUP_DESCRIPTION);
      List<String> membership = new LinkedList<String>();
      Attribute m = attr.get(membershipAttributeName);
      if (m != null) {
        for (Enumeration<?> en=m.getAll(); en.hasMoreElements();) {
          membership.add((String) en.nextElement());
View Full Code Here

      }

      List<IEntityGroup> rslt = new LinkedList<IEntityGroup>();
      if (gm.isGroup()) {   
          // Check the local indeces...
        IEntityGroup group = (IEntityGroup) gm;
        List<String> list = groupsTree.getParents().get(group.getLocalKey());
        if (list != null) {
          // should only reach this code if its a SmartLdap managed group...
            for (String s : list) {
              rslt.add(groupsTree.getGroups().get(s));
            }
View Full Code Here

        log.debug("Invoking findMemberGroupKeys() for group:  " + group.getLocalKey());
      }

      List<String> rslt = new LinkedList<String>();
      for (Iterator it=findMemberGroups(group); it.hasNext();) {
        IEntityGroup g = (IEntityGroup) it.next();
        // Return composite keys here...
        rslt.add(g.getKey());
      }
     
      return rslt.toArray(new String[0]);
     
    }
View Full Code Here

     * Implementation.
     */
   
    private static IEntityGroup createRootGroup() {
       
        IEntityGroup rslt = new EntityTestingGroupImpl(ROOT_KEY, IPerson.class);
        rslt.setCreatorID("System");
        rslt.setName(ROOT_KEY);
        rslt.setDescription(ROOT_DESC);
       
        return rslt;

    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.groups.IEntityGroup

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.