Package org.apache.jetspeed.services.security

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


        try
        {

            if (systemGroups.contains(groupname))
            {
                throw new GroupException("[" + groupname + "] is a system group and cannot be removed");
            }

            conn = Torque.getConnection();
            Group group = this.getGroup(groupname);

            Criteria criteria = new Criteria();
            criteria.add(TurbineGroupPeer.GROUP_NAME, groupname);

            if(cascadeDelete)
            {
                //CASCADE TURBINE_USER_GROUP_ROLE
                Criteria criteria1 = new Criteria();
                criteria1.add(TurbineUserGroupRolePeer.GROUP_ID, group.getId());
                TurbineUserGroupRolePeer.doDelete(criteria1, conn);
            }

            TurbineGroupPeer.doDelete(criteria, conn);
            PsmlManager.removeGroupDocuments(group);

            conn.commit();

        }
        catch(Exception e)
        {
            try
            {
                conn.rollback();
            }
            catch (java.sql.SQLException sqle)
            {
                logger.error("SQLException", sqle);
            }
            String message = "Failed to remove group '" + groupname + "'";
            logger.error( message, e );
            throw new GroupException( message, e );
        }
        finally
        {
            try
            {
View Full Code Here


        }
        catch(Exception e)
        {
            String message = "Join group '" + groupname + "' to user '" + username + "' failed: ";
            logger.error( message, e);
            throw new GroupException( message, e );           
        }
    }
View Full Code Here

        }
        catch(Exception e)
        {
            String message = "Unjoin group '" + groupname + "' to user '" + username + "' failed: ";
            logger.error( message, e);
            throw new GroupException( message, e );
        }

    }
View Full Code Here

        }
        catch(Exception e)
        {
            String message = "Failed to check group '" + groupname + "'";
            logger.error( message, e );
            throw new GroupException( message, e );
        }
        return ( groups.size() > 0 );
    }
View Full Code Here

        }
        catch(Exception e)
        {
            String message = "Failed to retrieve group '" + groupname + "'";
            logger.error( message, e );
            throw new GroupException(message, e);
        }
        if ( groups.size() > 1 )
        {
            throw new GroupException(
                "Multiple Groups with same groupname '" + groupname + "'");
        }
        if ( groups.size() == 1 )
        {
            TurbineGroup group = (TurbineGroup)groups.get(0);
            return group;
        }
        throw new GroupException("Unknown group '" + groupname + "'");

    }
View Full Code Here

            groups = TurbineGroupPeer.doSelect(criteria);
        }
        catch(Exception e)
        {
            logger.error( "Failed to check account's presence", e );
            throw new GroupException(
                "Failed to check account's presence", e);
        }
        if (groups.size() < 1)
        {
            return false;
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

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.