Examples of ExchangeDeclareBody


Examples of org.apache.qpid.framing.ExchangeDeclareBody

                        }

                    }
                    else if (parameters[0] instanceof ExchangeDeclareBody)
                    {
                        ExchangeDeclareBody body = (ExchangeDeclareBody) parameters[0];

                        AMQShortString exchangeName = body.getExchange();

                        Map create_exchanges = (Map) createRights.get(CREATE_EXCHANGES_KEY);

                        // If the exchange list is doesn't exist then all is allowed else check the valid exchanges
                        return create_exchanges == null || create_exchanges.containsKey(exchangeName);
View Full Code Here

Examples of org.apache.qpid.framing.ExchangeDeclareBody

    }

    public void sendExchangeDeclare(final AMQShortString name, final AMQShortString type, final AMQProtocolHandler protocolHandler,
            final boolean nowait) throws AMQException, FailoverException
    {
        ExchangeDeclareBody body = getMethodRegistry().createExchangeDeclareBody(getTicket(),name,type,
                                                                                 name.toString().startsWith("amq."),
                                                                                 false,false,false,false,null);
        AMQFrame exchangeDeclare = body.generateFrame(_channelId);

        protocolHandler.syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);
    }
View Full Code Here

Examples of org.apache.qpid.framing.ExchangeDeclareBody

    }

    void declareDestination(AMQDestination destination)
    {

        ExchangeDeclareBody body = getSession().getMethodRegistry().createExchangeDeclareBody(_session.getTicket(),
                                                                                              destination.getExchangeName(),
                                                                                              destination.getExchangeClass(),
                                                                                              false,
                                                                                              false,
                                                                                              false,
                                                                                              false,
                                                                                              true,
                                                                                              null);
        // Declare the exchange
        // Note that the durable and internal arguments are ignored since passive is set to false

        AMQFrame declare = body.generateFrame(_channelId);

        _protocolHandler.writeFrame(declare);
    }
View Full Code Here

Examples of org.apache.qpid.framing.ExchangeDeclareBody

    void declareDestination(AMQDestination destination)
    {

        final MethodRegistry methodRegistry = getSession().getMethodRegistry();
        ExchangeDeclareBody body =
                methodRegistry.createExchangeDeclareBody(getSession().getTicket(),
                                                         destination.getExchangeName(),
                                                         destination.getExchangeClass(),
                                                         destination.getExchangeName().toString().startsWith("amq."),
                                                         false,
                                                         false,
                                                         false,
                                                         true,
                                                         null);
        // Declare the exchange
        // Note that the durable and internal arguments are ignored since passive is set to false

        AMQFrame declare = body.generateFrame(getChannelId());

        getProtocolHandler().writeFrame(declare);
    }
View Full Code Here

Examples of org.apache.qpid.framing.ExchangeDeclareBody

        else
        {
            if (getSession().isDeclareExchanges())
            {
                final MethodRegistry methodRegistry = getSession().getMethodRegistry();
                ExchangeDeclareBody body =
                        methodRegistry.createExchangeDeclareBody(getSession().getTicket(),
                                                                 destination.getExchangeName(),
                                                                 destination.getExchangeClass(),
                                                                 destination.getExchangeName()
                                                                         .toString()
                                                                         .startsWith("amq."),
                                                                 destination.isExchangeDurable(),
                                                                 destination.isExchangeAutoDelete(),
                                                                 destination.isExchangeInternal(),
                                                                 true,
                                                                 null);
                AMQFrame declare = body.generateFrame(getChannelId());

                getConnection().getProtocolHandler().writeFrame(declare);
            }
        }
    }
View Full Code Here

Examples of org.apache.qpid.framing.ExchangeDeclareBody

        AMQSession_0_8 session = (AMQSession_0_8) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Set no wait true so that we block the connection
        // 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
Copyright © 2018 www.massapi.com. 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.