Package org.apache.jetspeed.services.security

Examples of org.apache.jetspeed.services.security.GroupException


                groupClassName = serviceConf.getString(CONFIG_GROUP_CLASSNAME);                                                            
                groupClass = Class.forName(groupClassName);
            }
            catch(Exception e)
            {
                throw new GroupException(
                    "GroupFactory: Failed to create a Class object for Group implementation: " + e.toString());
            }
        }

        try
        {
            group = (Group)groupClass.newInstance();
            if (group instanceof BaseJetspeedGroup)
            {
                ((BaseJetspeedGroup)group).setNew(isNew);
            }           
        }
        catch(Exception e)
        {
            throw new GroupException("Failed instantiate an Group implementation object: " + e.toString());
        }

        return group;
    }
View Full Code Here


        removeutil("createTimeStamp", false);
        removeutil("modifyTimeStamp", false);      

        if (create)
        {
            if (JetspeedLDAP.addEntry(super.ldapurl, super.myAttrs) == false) throw new GroupException("Failed to insert group in LDAP!");
        }
        else if (JetspeedLDAP.exists(super.ldapurl))
        {
            JetspeedLDAP.deleteAttrs(super.ldapurl, super.rmAttrs);
            if (JetspeedLDAP.updateEntry(super.ldapurl, super.myAttrs) == false) throw new GroupException("Failed to update group in LDAP!");
        }
    }
View Full Code Here

        {
            user = (LDAPUser)JetspeedSecurity.getUser(new UserNamePrincipal(username));
        }
        catch(JetspeedSecurityException e)
        {
            throw new GroupException("Failed to Retrieve User: ", e);
        }

        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);
        }

        return groups.iterator();
    }
View Full Code Here

                throw new UnknownUserException("No groups");
            }
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to retrieve groups ", e);
        }

        return groups.iterator();
    }
View Full Code Here

    {
        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

                removeGroup(group.getName());
            }
            catch(Exception e2)
            {
            }
            throw new GroupException("Failed to create Group PSML", e);
        }
    }
View Full Code Here

    public void saveGroup(Group group)
        throws JetspeedSecurityException
    {
        if(!groupExists(group.getName()))
        {
            throw new GroupException("The group '" +
                group.getName() + "' doesn't exists");
        }

        try
        {
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to create group '" +
                group.getName() + "'", e);
        }
    }
View Full Code Here

            PsmlManager.removeGroupDocuments(group);
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to remove group '" +
                groupname + "'", e);
        }
    }
View Full Code Here

        {
            user = (LDAPUser)JetspeedSecurity.getUser(new UserNamePrincipal(username));
        }
        catch(JetspeedSecurityException e)
        {
            throw new GroupException("Failed to Retrieve User: ", e);
        }
        try
        {
            user.addGroupRole(groupname, defaultRole);
            user.update(false);
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to add group info ", e);
        }
    }
View Full Code Here

            user = (LDAPUser)JetspeedSecurity.getUser(new UserNamePrincipal(username));
            role = (LDAPRole)JetspeedSecurity.getRole(rolename);
        }
        catch(JetspeedSecurityException e)
        {
            throw new GroupException("Failed to Retrieve User: ", e);
        }
        try
        {
            user.addGroupRole(groupname, rolename);
            user.update(false);
        }
        catch(Exception e)
        {
            throw new GroupException("Failed to add group info ", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.services.security.GroupException

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.