Package org.apache.turbine.util.security

Examples of org.apache.turbine.util.security.GroupSet


    public void testDatabase()
      throws Exception
    {
        SecurityService ss = TurbineSecurity.getService();

        GroupSet gs = ss.getAllGroups();
        RoleSet rs = ss.getAllRoles();
        PermissionSet ps = ss.getAllPermissions();

        List users = ss.getUserManager().retrieveList(new org.apache.torque.util.Criteria());

        assertEquals("Group DB Wrong!", gs.size(), 2);
        assertEquals("Role DB Wrong!", rs.size(), 2);
        assertEquals("Permission DB Wrong!", ps.size(), 3);
    }
View Full Code Here


        }
        catch (NamingException ex)
        {
            throw new DataBackendException("NamingException caught", ex);
        }
        return new GroupSet(groups);
    }
View Full Code Here

     * @throws DataBackendException if there is an error with LDAP
     */
    public boolean checkExists(Group group)
            throws DataBackendException
    {
        GroupSet groupSet = getGroups(new Criteria());

        return groupSet.contains(group);
    }
View Full Code Here

     * @return a GroupSet
     */
    public static GroupSet retrieveSet(Criteria criteria) throws Exception
    {
        List results = GroupPeer.doSelect(criteria);
        GroupSet rs = new GroupSet();
        for (int i = 0; i < results.size(); i++)
        {
            rs.add((Group) results.get(i));
        }
        return rs;
    }
View Full Code Here

        }
        catch (Exception e)
        {
            throw new DataBackendException("getGroups(Criteria) failed", e);
        }
        return new GroupSet(groups);
    }
View Full Code Here

     */
    public static GroupSet retrieveSet(Criteria criteria)
        throws Exception
    {
        List results = doSelect(criteria);
        GroupSet gs = new GroupSet();

        for(Iterator it = results.iterator(); it.hasNext(); )
        {
            gs.add((Group) it.next());
        }
        return gs;
    }
View Full Code Here

    public void testAllGroups()
            throws Exception
    {
        SecurityService ss = TurbineSecurity.getService();

        GroupSet gs = ss.getAllGroups();

        assertEquals(2, gs.size());
    }
View Full Code Here

        }
        catch (Exception e)
        {
            throw new DataBackendException("getGroups(Criteria) failed", e);
        }
        return new GroupSet(groups);
    }
View Full Code Here

     * @return an object representing the Group with specified name.
     */
    public Group getGroup( String name )
        throws DataBackendException, UnknownEntityException
    {
        GroupSet groups = getAllGroups();
        Group group = groups.getGroup(name);
        if(group != null)
        {
            return group;
        }
        else
View Full Code Here

     * Retrieves/assembles a GroupSet based on the Criteria passed in
     */
    public static GroupSet retrieveSet(Criteria criteria) throws Exception
    {
        Vector results = GroupPeer.doSelect(criteria);
        GroupSet rs = new GroupSet();
        for (int i=0; i<results.size(); i++)
        {
            rs.add( (Group)results.elementAt(i) );
        }
        return rs;
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.security.GroupSet

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.