Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.AMQFrame


                AMQBody cb =
                        getProtocolVersionMethodConverter().convertToBody(_messageHandle.getContentChunk(getStoreContext(),
                                                                                                         _messageId, ++_index));

                return new AMQFrame(_channel, cb);
            }
            catch (AMQException e)
            {
                // have no choice but to throw a runtime exception
                throw new RuntimeException("Error getting content body: " + e, e);
View Full Code Here


                                                  virtualHost.getExchangeRegistry());
        session.addChannel(channel);
        // 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.
        AMQFrame response = ChannelOpenOkBody.createAMQFrame(evt.getChannelId(), (byte)8, (byte)0);
        session.writeFrame(response);
    }
View Full Code Here

        stateManager.getProtocolSession().closeChannelOk(channelId);

        // 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.
        AMQFrame response = ChannelCloseOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0);
        session.writeFrame(response);
    }
View Full Code Here

    public void closeConnection() throws JMException
    {
        // 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.
        final AMQFrame response =
            ConnectionCloseBody.createAMQFrame(0, _session.getProtocolMajorVersion(), _session.getProtocolMinorVersion(), // AMQP version (major, minor)
                0, // classId
                0, // methodId
                AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
                BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION // replyText
View Full Code Here

                    _logger.info("Authentication failed");
                    stateManager.changeState(AMQState.CONNECTION_CLOSING);
                    // 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.
                    AMQFrame close = ConnectionCloseBody.createAMQFrame(0,
                                                                        (byte) 8, (byte) 0,    // AMQP version (major, minor)
                                                                        ConnectionCloseBody.getClazz((byte) 8, (byte) 0),        // classId
                                                                        ConnectionCloseBody.getMethod((byte) 8, (byte) 0),    // methodId
                                                                        AMQConstant.NOT_ALLOWED.getCode(),    // replyCode
                                                                        AMQConstant.NOT_ALLOWED.getName());    // replyText
                    session.writeFrame(close);
                    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.
                    AMQFrame tune = ConnectionTuneBody.createAMQFrame(0,
                                                                      (byte) 8, (byte) 0,    // AMQP version (major, minor)
                                                                      Integer.MAX_VALUE,    // channelMax
                                                                      getConfiguredFrameSize(),    // frameMax
                                                                      HeartbeatConfig.getInstance().getDelay());    // heartbeat
                    session.writeFrame(tune);
                    break;
                case CONTINUE:
                    stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
                    // 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.
                    AMQFrame challenge = ConnectionSecureBody.createAMQFrame(0,
                                                                             (byte) 8, (byte) 0,    // AMQP version (major, minor)
                                                                             authResult.challenge);    // challenge
                    session.writeFrame(challenge);
            }
        }
View Full Code Here

        if (!body.nowait)
        {
            // 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.
            AMQFrame response = QueueDeclareOkBody.createAMQFrame(evt.getChannelId(),
                                                                  (byte) 8, (byte) 0,    // AMQP version (major, minor)
                                                                  queue.getConsumerCount(), // consumerCount
                                                                  queue.getMessageCount(), // messageCount
                                                                  body.queue); // queue
            _log.info("Queue " + body.queue + " declared successfully");
View Full Code Here

        if(!body.nowait)
        {
            // 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.
            AMQFrame response = ExchangeDeclareOkBody.createAMQFrame(evt.getChannelId(), (byte)8, (byte)0);
            session.writeFrame(response);
        }
    }
View Full Code Here

                _logger.info("Authentication failed");
                stateManager.changeState(AMQState.CONNECTION_CLOSING);
                // 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.
                AMQFrame close = ConnectionCloseBody.createAMQFrame(0,
                    (byte)8, (byte)0// AMQP version (major, minor)
                    ConnectionCloseBody.getClazz((byte)8, (byte)0),    // classId
                    ConnectionCloseBody.getMethod((byte)8, (byte)0)// methodId
                    AMQConstant.NOT_ALLOWED.getCode()// replyCode
                    AMQConstant.NOT_ALLOWED.getName())// replyText
                session.writeFrame(close);
                disposeSaslServer(session);
                break;
            case SUCCESS:
                _logger.info("Connected as: " + ss.getAuthorizationID());
                stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
                // TODO: Check the value of channelMax here: This should be the max
                // value of a 2-byte unsigned integer (as channel is only 2 bytes on the wire),
                // not Integer.MAX_VALUE (which is signed 4 bytes).
                // 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.
                AMQFrame tune = ConnectionTuneBody.createAMQFrame(0,
                    (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)
                // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
                // Be aware of possible changes to parameter order as versions change.
                AMQFrame challenge = ConnectionSecureBody.createAMQFrame(0,
                    (byte)8, (byte)0// AMQP version (major, minor)
                    authResult.challenge)// challenge
                session.writeFrame(challenge);
        }
    }
View Full Code Here

        {
            MethodRegistry_8_0 registry = new MethodRegistry_8_0();

            ExchangeDeleteBody body = registry.createExchangeDeleteBody(0, new AMQShortString(_name), false, true);

            AMQFrame exchangeDeclare = body.generateFrame(0);

            ((AMQConnection) _connection).getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeleteOkBody.class);
        }

        //Wait and ensure we get our last EXH-1002 msg
View Full Code Here

        // Also set a different exchange class string so the attempt to declare
        // the exchange causes an exchange.
        ExchangeDeclareBody body = session.getMethodRegistry().createExchangeDeclareBody(session.getTicket(), new AMQShortString(EXCHANGE_NAME), null,
                                                                                         true, false, false, false, true, null);

        AMQFrame exchangeDeclare = body.generateFrame(session.getChannelId());

        try
        {
            // block our thread so that can times out
            connection.getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);
View Full Code Here

TOP

Related Classes of org.apache.qpid.framing.AMQFrame

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.