Package org.apache.jetspeed.services.security

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


        }
        catch(Exception e)
        {
            String message = "Revoke role '" + rolename + "' to user '" + username + "' failed: ";
            logger.error( message, e );
            throw new RoleException( message, e );
        }

    }
View Full Code Here


        }
        catch(Exception e)
        {
            String message = "Failed to check role '" + rolename + "'";
            logger.error( message, e );
            throw new RoleException( message, e );
        }
        return ( roles.size() > 0 );
    }
View Full Code Here

        }
        catch(Exception e)
        {
            String message = "Failed to retrieve role '" + rolename + "'";
            logger.error( message, e );
            throw new RoleException( message, e);
        }
        if ( roles.size() > 1 )
        {
            throw new RoleException(
                "Multiple Roles with same rolename '" + rolename + "'");
        }
        if ( roles.size() == 1 )
        {
            TurbineRole role = (TurbineRole)roles.get(0);
            return role;
        }
        throw new RoleException("Unknown role '" + rolename + "'");

    }
View Full Code Here

            roles = TurbineRolePeer.doSelect(criteria);
        }
        catch(Exception e)
        {
            logger.error( "Failed to check account's presence", e );
            throw new RoleException(
                "Failed to check account's presence", e);
        }
        if (roles.size() < 1)
        {
            return false;
View Full Code Here

        {
            roles = TurbineRolePeer.doSelect(criteria);
        }
        catch(Exception e)
        {
            throw new RoleException("Failed to retrieve roles ", e);
        }
        return roles.iterator();
    }
View Full Code Here

    public void addRole(Role role)
        throws JetspeedSecurityException
    {
        if(roleExists(role.getName()))
        {
            throw new RoleException("The role '" +
                role.getName() + "' already exists");
        }

        try
        {
            TurbineRole trole = new TurbineRole();
            trole.setRoleName(role.getName());
            Criteria criteria = TurbineRolePeer.buildCriteria(trole);
            NumberKey key = (NumberKey)TurbineRolePeer.doInsert(criteria);
            role.setId(key.toString());
        }
        catch(Exception e)
        {
            throw new RoleException("Failed to create role '" +
                role.getName() + "'", e);
        }

        if (cachingEnable)
        {
            JetspeedSecurityCache.addRole(role);
        }

        try
        {
            addDefaultRolePSML(role);
        }
        catch (Exception e)
        {
            try
            {
                removeRole(role.getName());
            }
            catch (Exception e2)
            {
            }
            throw new RoleException("failed to add default PSML for Role resource", e);
        }

    }
View Full Code Here

                removeRole(role.getName());
            }
            catch(Exception e2)
            {
            }
            throw new RoleException("Failed to create Role PSML", e);
        }
    }
View Full Code Here

    public void saveRole(Role role)
        throws JetspeedSecurityException
    {
        if(!roleExists(role.getName()))
        {
            throw new RoleException("The role '" +
                role.getName() + "' doesn't exists");
        }

        try
        {
            if (role instanceof TurbineRole)
            {
                TurbineRolePeer.doUpdate((TurbineRole)role);
            }
            else
            {
                throw new RoleException("TurbineRoleManagment: Role is not a Turbine role, cannot update");
            }

        }
        catch(Exception e)
        {
            throw new RoleException("Failed to create role '" +
                role.getName() + "'", e);
        }

    }
View Full Code Here

            }
            catch (java.sql.SQLException sqle)
            {
                Log.error(sqle);
            }
            throw new RoleException("Failed to remove role '" +
                rolename + "'", e);
        }
        finally
        {
            try
View Full Code Here

                JetspeedSecurityCache.addRole(username, role);
            }
        }
        catch(Exception e)
        {
            throw new RoleException("Grant role '" + rolename + "' to user '" + username + "' failed: ", e);
        }
    }
View Full Code Here

TOP

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

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.