Package org.apache.qpid.server.security.auth.sasl

Examples of org.apache.qpid.server.security.auth.sasl.UsernamePrincipal


    public Principal getUser(String username)
    {
        if (_users.containsKey(username))
        {
            return new UsernamePrincipal(username);
        }
        return null;
    }
View Full Code Here


    public Principal getUser(String username)
    {
        if (_users.getProperty(username) != null)
        {
            return new UsernamePrincipal(username);
        }
        else
        {
            return null;
        }
View Full Code Here

                    disposeSaslServer(session);
                    break;

                case SUCCESS:
                    _logger.info("Connected as: " + ss.getAuthorizationID());
                    session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));

                    stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
                    // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
                    // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
                    // Be aware of possible changes to parameter order as versions change.
View Full Code Here

                    (byte)8, (byte)0// AMQP version (major, minor)
                    Integer.MAX_VALUE,  // channelMax
                    ConnectionStartOkMethodHandler.getConfiguredFrameSize()// frameMax
                    HeartbeatConfig.getInstance().getDelay())// heartbeat
                session.writeFrame(tune);
                session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));               
                disposeSaslServer(session);
                break;
            case CONTINUE:
                stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
                // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
View Full Code Here

    public boolean setPassword(String username, String password)
    {
        try
        {
            //delegate password changes to the Principal Database
            return _principalDatabase.updatePassword(new UsernamePrincipal(username), password.toCharArray());
        }
        catch (AccountNotFoundException e)
        {
            _logger.warn("Attempt to set password of non-existent user'" + username + "'");
            return false;
View Full Code Here

        }
    }

    public boolean createUser(String username, String password)
    {
        if (_principalDatabase.createPrincipal(new UsernamePrincipal(username), password.toCharArray()))
        {
            return true;
        }

        return false;
View Full Code Here

    public boolean deleteUser(String username)
    {
        try
        {
            _principalDatabase.deletePrincipal(new UsernamePrincipal(username));
        }
        catch (AccountNotFoundException e)
        {
            _logger.warn("Attempt to delete user (" + username + ") that doesn't exist");
            return false;
View Full Code Here

            Principal username = null;
            for (Callback callback : callbacks)
            {
                if (callback instanceof NameCallback)
                {
                    username = new UsernamePrincipal(((NameCallback) callback).getDefaultName());
                }
                else if (callback instanceof PasswordCallback)
                {
                    try
                    {
View Full Code Here

    public Principal getUser(String username)
    {
        if (_users.containsKey(username))
        {
            return new UsernamePrincipal(username);
        }
        return null;
    }
View Full Code Here

    public Principal getUser(String username)
    {
        if (_users.containsKey(username))
        {
            return new UsernamePrincipal(username);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.auth.sasl.UsernamePrincipal

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.