Package org.apache.jetspeed.om.security.ldap

Examples of org.apache.jetspeed.om.security.ldap.LDAPGroup


        try
        {
            for (Enumeration enum1 = user.getGroupRoles().elements(); enum1.hasMoreElements();)
            {
                st = new StringTokenizer((String)enum1.nextElement(), ",");
                LDAPGroup group = new LDAPGroup(st.nextToken(),false);
                LDAPRole role = new LDAPRole(st.nextToken(),false);
                BaseJetspeedGroupRole groupRole = new BaseJetspeedGroupRole();
                groupRole.setGroup(group);
                groupRole.setRole(role);
                roles.put(group.getName() + role.getName(), groupRole);
            }
        }
        catch(Exception e)
        {
            throw new RoleException("Failed to retrieve groups ", e);
View Full Code Here


        try
        {
            for (Enumeration enum1 = user.getGroupRoles().elements() ;enum1.hasMoreElements() ;)
            {
                st = new StringTokenizer((String)enum1.nextElement(),",");
                groups.add(new LDAPGroup(st.nextToken(), false));
            }
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to retrieve groups ", e);
View Full Code Here

                                        "(objectclass=jetspeedgroup)", ATTRS, true);
            if (groupurls.size() > 0)
            {
                for (Enumeration enum1 = groupurls.elements();enum1.hasMoreElements() ;)
                {
                    groups.add(new LDAPGroup((LDAPURL) (((Vector)enum1.nextElement()).firstElement())));
                }
            }
            else
            {
                throw new UnknownUserException("No groups");
View Full Code Here

     *
     */
    public void addGroup(Group group)
        throws JetspeedSecurityException
    {
        LDAPGroup ldapGroup = null;

        if(groupExists(group.getName()))
        {
            throw new GroupException("The group '" +
                group.getName() + "' already exists");
        }
        try
        {
            ldapGroup = new LDAPGroup(group.getName(), true);
            ldapGroup.update(true);
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to create group '" +
                group.getName() + "'", e);
        }

        try
        {
            addDefaultGroupPSML(ldapGroup);
        }
        catch (Exception e)
        {
            try
            {
                removeGroup(ldapGroup.getName());
            }
            catch (Exception e2)
            {
            }
            throw new GroupException("failed to add default PSML for Group resource", e);
View Full Code Here

    public void removeGroup(String groupname)
        throws JetspeedSecurityException
    {
        try
        {
            LDAPGroup group = new LDAPGroup(groupname, false);
            JetspeedLDAP.deleteEntry(group.getldapurl());

            if(cascadeDelete)
            {
            }
View Full Code Here

     */
    public Group getGroup(String groupname)
        throws JetspeedSecurityException
    {
        BasicAttributes attr= new BasicAttributes();
        LDAPGroup group;
        Vector groupurls;

        try
        {
            groupurls = JetspeedLDAP.search(JetspeedLDAP.buildURL("ou=groups"),
                         "(&(uid="+ groupname+")(objectclass=jetspeedgroup))", ATTRS, true);
            if (groupurls.size() == 1)
            {
                return new LDAPGroup((LDAPURL)((Vector)groupurls.elementAt(0)).firstElement());
            }
            else if(groupurls.size() > 1)
            {
                throw new GroupException("Multiple groups with same name");
            }
View Full Code Here

     */
    public HashMap getTurbineGroupRole(String username)
         throws JetspeedSecurityException
    {
      BasicAttributes attr= new BasicAttributes();
      LDAPGroup group;
      Vector groupurls;
      HashMap h = new HashMap();
      return h;
    }
View Full Code Here

     *
     */
    public void addGroup(Group group)
        throws JetspeedSecurityException
    {
        LDAPGroup ldapGroup = null;

        if(groupExists(group.getName()))
        {
            throw new GroupException("The group '" +
                group.getName() + "' already exists");
        }
        try
        {
            ldapGroup = new LDAPGroup(group.getName(), true);
            ldapGroup.update(true);
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to create group '" +
                group.getName() + "'", e);
        }

        try
        {
            addDefaultGroupPSML(ldapGroup);
        }
        catch (Exception e)
        {
            try
            {
                removeGroup(ldapGroup.getName());
            }
            catch (Exception e2)
            {
            }
            throw new GroupException("failed to add default PSML for Group resource", e);
View Full Code Here

    public void removeGroup(String groupname)
        throws JetspeedSecurityException
    {
        try
        {
            LDAPGroup group = new LDAPGroup(groupname, false);
            JetspeedLDAP.deleteEntry(group.getldapurl());

            if(cascadeDelete)
            {
            }
View Full Code Here

     */
    public Group getGroup(String groupname)
        throws JetspeedSecurityException
    {
        BasicAttributes attr= new BasicAttributes();
        LDAPGroup group;
        Vector groupurls;
        try
        {
            groupurls = JetspeedLDAP.search(JetspeedLDAP.buildURL("ou=groups"),
                         "(&(uid="+ groupname+")(objectclass=jetspeedgroup))", ATTRS, true);
            if (groupurls.size() == 1)
            {
                return new LDAPGroup((LDAPURL)((Vector)groupurls.elementAt(0)).firstElement());
            }
            else if(groupurls.size() > 1)
            {
                throw new GroupException("Multiple groups with same name");
            }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.security.ldap.LDAPGroup

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.