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

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


        return createUser(username, password.toCharArray(), read, write, admin);
    }

    public boolean createUser(String username, char[] password, boolean read, boolean write, boolean admin)
    {
        if (_principalDatabase.createPrincipal(new UsernamePrincipal(username), password))
        {
            if (!setRights(username, read, write, admin))
            {
                //unable to set rights for user, remove account
                try
                {
                    _principalDatabase.deletePrincipal(new UsernamePrincipal(username));
                }
                catch (AccountNotFoundException e)
                {
                    //ignore
                }
View Full Code Here


    public boolean deleteUser(String username)
    {
        try
        {
            if (_principalDatabase.deletePrincipal(new UsernamePrincipal(username)))
            {
                try
                {
                    _accessRightsUpdate.lock();
View Full Code Here

                ConnectionTuneBody tuneBody =
                        methodRegistry.createConnectionTuneBody(ApplicationRegistry.getInstance().getConfiguration().getMaxChannelCount(),
                                                                ConnectionStartOkMethodHandler.getConfiguredFrameSize(),
                                                                ApplicationRegistry.getInstance().getConfiguration().getHeartBeatDelay());
                session.writeFrame(tuneBody.generateFrame(0));
                session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));
                disposeSaslServer(session);               
                break;
            case CONTINUE:
                stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
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);

                    ConnectionTuneBody tuneBody = methodRegistry.createConnectionTuneBody(ApplicationRegistry.getInstance().getConfiguration().getMaxChannelCount(),
                                                                                          getConfiguredFrameSize(),
View Full Code Here

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

        return true;
    }

    public boolean createUser(String username, char[] password, boolean read, boolean write, boolean admin)
    {
        if (_principalDatabase.createPrincipal(new UsernamePrincipal(username), password))
        {
            if (!setRights(username, read, write, admin))
            {
                //unable to set rights for user, remove account
                try
                {
                    _principalDatabase.deletePrincipal(new UsernamePrincipal(username));
                }
                catch (AccountNotFoundException e)
                {
                    //ignore
                }
View Full Code Here

    public boolean deleteUser(String username)
    {
        try
        {
            if (_principalDatabase.deletePrincipal(new UsernamePrincipal(username)))
            {
                try
                {
                    _accessRightsUpdate.lock();
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);

                    ConnectionTuneBody tuneBody = methodRegistry.createConnectionTuneBody(0xFFFF,
                                                                                          getConfiguredFrameSize(),
View Full Code Here

                ConnectionTuneBody tuneBody =
                        methodRegistry.createConnectionTuneBody(0xFFFF,
                                                                ConnectionStartOkMethodHandler.getConfiguredFrameSize(),
                                                                ApplicationRegistry.getInstance().getConfiguration().getHeartBeatDelay());
                session.writeFrame(tuneBody.generateFrame(0));
                session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));
                disposeSaslServer(session);
                break;
            case CONTINUE:
                stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
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.