Package javax.security.auth.login

Examples of javax.security.auth.login.AccountNotFoundException


        {
            callback.setPassword(pwd.toCharArray());
        }
        else
        {
            throw new AccountNotFoundException("No account found for principal " + principal);
        }
    }
View Full Code Here


    /**
     * @tests javax.security.auth.login.AccountNotFoundException#AccountNotFoundException()
     */
    public final void testCtor1() {
        assertNull(new AccountNotFoundException().getMessage());
    }
View Full Code Here

    /**
     * @tests javax.security.auth.login.AccountNotFoundException#AccountNotFoundException(
     *        java.lang.String)
     */
    public final void testCtor2() {
        assertNull(new AccountNotFoundException(null).getMessage());

        String message = "";
        assertSame(message, new AccountNotFoundException(message).getMessage());

        message = "message";
        assertSame(message, new AccountNotFoundException(message).getMessage());
    }
View Full Code Here

public class AccountNotFoundExceptionTest extends SerializationTest {

    @Override
    protected Object[] getData() {
        return new Object[] {new AccountNotFoundException("message")};
    }
View Full Code Here

     */
    public void setPassword(Principal principal, PasswordCallback callback) throws AccountNotFoundException
    {
        if (_passwordFile == null)
        {
            throw new AccountNotFoundException("Unable to locate principal since no password file was specified during initialisation");
        }
        if (principal == null)
        {
            throw new IllegalArgumentException("principal must not be null");
        }
        char[] pwd = lookupPassword(principal.getName());
       
        if (pwd != null)
        {
            callback.setPassword(pwd);
        }
        else
        {
            throw new AccountNotFoundException("No account found for principal " + principal);
        }
    }
View Full Code Here

        char[] pwd = lookupPassword(principal);
       
        if (pwd == null)
        {
            throw new AccountNotFoundException("Unable to lookup the specfied users password");
        }

        return compareCharArray(pwd, password);

    }
View Full Code Here

    {
        PlainUser user = _users.get(principal.getName());

        if (user == null)
        {
            throw new AccountNotFoundException(principal.getName());
        }

        try
        {
            try
View Full Code Here

    {
        PlainUser user = _users.get(principal.getName());

        if (user == null)
        {
            throw new AccountNotFoundException(principal.getName());
        }

        try
        {
            _userUpdate.lock();
View Full Code Here

     */
    public void setPassword(Principal principal, PasswordCallback callback) throws AccountNotFoundException
    {
        if (_passwordFile == null)
        {
            throw new AccountNotFoundException("Unable to locate principal since no password file was specified during initialisation");
        }
        if (principal == null)
        {
            throw new IllegalArgumentException("principal must not be null");
        }

        char[] pwd = lookupPassword(principal.getName());

        if (pwd != null)
        {
            callback.setPassword(pwd);
        }
        else
        {
            throw new AccountNotFoundException("No account found for principal " + principal);
        }
    }
View Full Code Here

    {
        char[] pwd = lookupPassword(principal);
       
        if (pwd == null)
        {
            throw new AccountNotFoundException("Unable to lookup the specfied users password");
        }
       
        byte[] byteArray = new byte[password.length];
        int index = 0;
        for (char c : password)
View Full Code Here

TOP

Related Classes of javax.security.auth.login.AccountNotFoundException

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.