Package org.apache.turbine.util.security

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


        {
            users = UserPeerManager.doSelect(criteria);
        }
        catch (Exception e)
        {
            throw new DataBackendException(
                "Failed to check account's presence", e);
        }
        if (users.size() > 1)
        {
            throw new DataBackendException(
                "Multiple Users with same username '" + userName + "'");
        }
        return (users.size() == 1);
    }
View Full Code Here


        List users = retrieveList(criteria);;

        if (users.size() > 1)
        {
            throw new DataBackendException(
                "Multiple Users with same username '" + userName + "'");
        }
        if (users.size() == 1)
        {
            return (User) users.get(0);
View Full Code Here

        List users = retrieveList(criteria);

        if (users.size() > 1)
        {
            throw new DataBackendException(
                "Multiple Users with same unique Key '" + String.valueOf(key) + "'");
        }
        if (users.size() == 1)
        {
            return (User) users.get(0);
View Full Code Here

        {
            users = UserPeerManager.doSelect(criteria);
        }
        catch (Exception e)
        {
            throw new DataBackendException("Failed to retrieve users", e);
        }
        return users;
    }
View Full Code Here

            ((Persistent) user).setModified(true);
            ((Persistent) user).save();
        }
        catch (Exception e)
        {
            throw new DataBackendException("Failed to save user object", e);
        }
    }
View Full Code Here

    public void createAccount(User user, String initialPassword)
        throws EntityExistsException, DataBackendException
    {
        if(StringUtils.isEmpty(user.getName()))
        {
            throw new DataBackendException("Could not create "
                                           + "an user with empty name!");
        }

        if (accountExists(user))
        {
            throw new EntityExistsException("The account '" +
                                            user.getName() + "' already exists");
        }
        user.setPassword(TurbineSecurity.encryptPassword(initialPassword));

        try
        {
            // this is to mimic the old behavior of the method, the user
            // should be new that is passed to this method.  It would be
            // better if this was checked, but the original code did not
            // care about the user's state, so we set it to be appropriate
            ((Persistent) user).setNew(true);
            ((Persistent) user).setModified(true);
            ((Persistent) user).save();
        }
        catch (Exception e)
        {
            throw new DataBackendException("Failed to create account '" +
                                           user.getName() + "'", e);
        }
    }
View Full Code Here

        {
            UserPeerManager.doDelete(criteria);
        }
        catch (Exception e)
        {
            throw new DataBackendException("Failed to remove account '" +
                                           user.getName() + "'", e);
        }
    }
View Full Code Here

                        + username + "\n does not exist.");
            }
        }
        catch (NamingException ex)
        {
            throw new DataBackendException(
                    "The LDAP server specified is unavailable", ex);
        }
    }
View Full Code Here

        criteria.addSelectColumn(PERMISSION_ID);
        criteria.add(NAME, ((SecurityObject) permission).getName());
        List results = BasePeer.doSelect(criteria);
        if (results.size() > 1)
        {
            throw new DataBackendException("Multiple permissions named '"
                    + ((SecurityObject) permission).getName() + "' exist!");
        }
        return (results.size() == 1);
    }
View Full Code Here

        criteria.addSelectColumn(ROLE_ID);
        criteria.add(NAME, role.getName());
        List results = BasePeer.doSelect(criteria);
        if (results.size() > 1)
        {
            throw new DataBackendException("Multiple roles named '"
                    + role.getName() + "' exist!");
        }
        return (results.size() == 1);
    }
View Full Code Here

TOP

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

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.