Package org.apache.jetspeed.services.security

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


            users = TurbineUserPeer.doSelect(criteria);
        }
        catch(Exception e)
        {
            logger.error( "Failed to check account's presence", e );
            throw new UserException(
                "Failed to check account's presence", e);
        }
        if (users.size() < 1)
        {
            return false;
        }
        TurbineUser retrieved = (TurbineUser)users.get(0);
        int key = retrieved.getUserId();
        String keyId = String.valueOf(key);
        if (checkUniqueId && !keyId.equals(id))
        {
            throw new UserException("User exists but under a different unique ID");
        }
        return true;
    }
View Full Code Here


                       "(&(uid="+principal.getName()+")(objectclass=jetspeeduser))", ATTRS, true);
        }
        catch (Exception e)
        {
            logger.error( "Failed to retrieve user '" + principal.getName() + "'", e );
            throw new UserException("Failed to retrieve user '" + principal.getName() + "'", e);
        }
        
        if (userurls.size() == 1)
        {
            user = new LDAPUser((LDAPURL) ((Vector)userurls.elementAt(0)).firstElement());
            return user;
        }
        else if(userurls.size() > 1)
        {
            throw new UserException("Multiple Users with same username '" + principal.getName() + "'");
        }
        else
        {
            throw new UnknownUserException("Unknown user '" + principal.getName() + "'");
        }
View Full Code Here

            JetspeedLDAP.getService().checkAndCloseContext(ctx);
        }
        catch ( Exception e )
        {
            logger.error( "Failed to retrieve user with filter:" + filter, e );
            throw new UserException( "Failed to retrieve user with filter:" + filter, e );
        }

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

            ((LDAPUser)user).update(false);
        }
        catch(Exception e)
        {
            logger.error( "Failed to save user object ", e);
            throw new UserException("Failed to save user object ", e);
        }
    }
View Full Code Here

        }
        catch (Exception e)
        {
            logger.error( "Failed to create profile for new user ", e );
            removeUser(new UserNamePrincipal(user.getUserName()));
            throw new UserException("Failed to create profile for new user ", e);
        }
    }
View Full Code Here

            PsmlManager.removeUserDocuments(user);
        }
        catch(Exception e)
        {
            logger.error( "Failed to remove account '" + user.getUserName() + "'", e );
            throw new UserException("Failed to remove account '" +
                user.getUserName() + "'", e);
        }

    }
View Full Code Here

            throw new UnknownUserException("The account '" +
                user.getUserName() + "' does not exist");
        }
        else if (!passwordsMatch(user, oldPassword))
        {
            throw new UserException(
               "The supplied old password for '" + user.getUserName() +
                "' was incorrect");
        }

        String encrypted = JetspeedSecurity.encryptPassword( newPassword );
View Full Code Here

        {
            criteria.add(TurbineUserPeer.USER_ID, principal.getName());
        }
        else
        {
            throw new UserException("Invalid Principal Type in getUser: " + principal.getClass().getName());
        }
        List users;
        try
        {
            users = TurbineUserPeer.doSelectUsers(criteria);
        }
        catch(Exception e)
        {
            String message = "Failed to retrieve user '" + principal.getName() + "'";
            logger.error( message, e );
            throw new UserException( message, e );
        }
        if ( users.size() > 1 )
        {
            throw new UserException(
                "Multiple Users with same username '" + principal.getName() + "'");
        }
        if ( users.size() == 1 )
        {
            return (JetspeedUser)users.get(0);
View Full Code Here

            users = TurbineUserPeer.doSelectUsers(criteria);
        }
        catch(Exception e)
        {
            logger.error( "Failed to retrieve users ", e );
            throw new UserException("Failed to retrieve users ", e);
        }
        return users.iterator();
    }
View Full Code Here

            users = TurbineUserPeer.doSelectUsers(criteria);
        }
        catch(Exception e)
        {
            logger.error( "Failed to retrieve users ", e );
            throw new UserException("Failed to retrieve users ", e);
        }
        return users.iterator();
    }
View Full Code Here

TOP

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

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.