Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.QueueDeleteBody


        protocolHandler.syncWrite(queueDeclare, QueueDeclareOkBody.class);
    }

    public void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException
    {
        QueueDeleteBody body = getMethodRegistry().createQueueDeleteBody(getTicket(),
                                                                         queueName,
                                                                         false,
                                                                         false,
                                                                         true);
        AMQFrame queueDeleteFrame = body.generateFrame(_channelId);

        getProtocolHandler().syncWrite(queueDeleteFrame, QueueDeleteOkBody.class);
    }
View Full Code Here


        super.autodelete();

        //send delete request to peers:
        // 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.
        QueueDeleteBody request = new QueueDeleteBody((byte)8, (byte)0,
                                                      QueueDeleteBody.getClazz((byte)8, (byte)0),
                                                      QueueDeleteBody.getMethod((byte)8, (byte)0),
                                                      false,false,false,null,0);
        request.queue = getName();
        _groupMgr.broadcast(new SimpleBodySendable(request));
View Full Code Here

            delete();

            //send deletion request to all other members:
          // 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.
            QueueDeleteBody request = new QueueDeleteBody((byte)8,
                                                          (byte)0,
                                                          QueueDeleteBody.getClazz((byte)8,(byte)0),
                                                          QueueDeleteBody.getMethod((byte)8,(byte)0),
                                                          false,
                                                          false,
View Full Code Here

        AMQProtocolSession session = stateManager.getProtocolSession();
        VirtualHost virtualHost = session.getVirtualHost();
        QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
        MessageStore store = virtualHost.getMessageStore();

        QueueDeleteBody body = evt.getMethod();
        AMQQueue queue;
        if (body.queue == null)
        {
            AMQChannel channel = session.getChannel(evt.getChannelId());

            if (channel == null)
            {
                throw body.getChannelNotFoundException(evt.getChannelId());
            }

            //get the default queue on the channel:           
            queue = channel.getDefaultQueue();
        }
        else
        {
            queue = queueRegistry.getQueue(body.queue);
        }

        if (queue == null)
        {
            if (_failIfNotFound)
            {
                throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.queue + " does not exist.");
            }
        }
        else
        {
            if (body.ifEmpty && !queue.isEmpty())
            {
                throw body.getChannelException(AMQConstant.IN_USE, "Queue: " + body.queue + " is not empty.");
            }
            else if (body.ifUnused && !queue.isUnused())
            {
                // TODO - Error code
                throw body.getChannelException(AMQConstant.IN_USE, "Queue: " + body.queue + " is still used.");

            }
            else
            {
                int purged = queue.delete(body.ifUnused, body.ifEmpty);
View Full Code Here

        protocolHandler.syncWrite(queueDeclare, QueueDeclareOkBody.class);
    }

    public void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException
    {
        QueueDeleteBody body = getMethodRegistry().createQueueDeleteBody(getTicket(),
                                                                         queueName,
                                                                         false,
                                                                         false,
                                                                         true);
        AMQFrame queueDeleteFrame = body.generateFrame(_channelId);

        getProtocolHandler().syncWrite(queueDeleteFrame, QueueDeleteOkBody.class);
    }
View Full Code Here

    }

    public void methodReceived(AMQStateManager stateMgr, QueueRegistry queues, ExchangeRegistry exchanges, AMQProtocolSession session, AMQMethodEvent<QueueDeleteBody> evt) throws AMQException
    {
        QueueDeleteBody body = evt.getMethod();
        AMQQueue queue;
        if(body.queue == null)
        {
            queue = session.getChannel(evt.getChannelId()).getDefaultQueue();
        }
        else
        {
            queue = queues.getQueue(body.queue);
        }

        if(queue == null)
        {
            if(_failIfNotFound)
            {
                throw body.getChannelException(404, "Queue " + body.queue + " does not exist.");
            }
        }
        else
        {
            int purged = queue.delete(body.ifUnused, body.ifEmpty);
View Full Code Here

    {
        //delete locally:
        super.autodelete();

        //send delete request to peers:
        QueueDeleteBody request = new QueueDeleteBody();
        request.queue = getName();
        _groupMgr.broadcast(new SimpleSendable(request));
    }
View Full Code Here

        {
            //delete locally:
            delete();

            //send deletion request to all other members:
            QueueDeleteBody request = new QueueDeleteBody();
            request.queue = getName();
            _groupMgr.broadcast(new SimpleSendable(request));
        }
    }
View Full Code Here

        protocolHandler.syncWrite(queueDeclare, QueueDeclareOkBody.class);
    }

    public void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException
    {
        QueueDeleteBody body = getMethodRegistry().createQueueDeleteBody(getTicket(),
                                                                         queueName,
                                                                         false,
                                                                         false,
                                                                         true);
        AMQFrame queueDeleteFrame = body.generateFrame(_channelId);

        getProtocolHandler().syncWrite(queueDeleteFrame, QueueDeleteOkBody.class);
    }
View Full Code Here

        protocolHandler.syncWrite(queueDeclare, QueueDeclareOkBody.class);
    }

    public void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException
    {
        QueueDeleteBody body = getMethodRegistry().createQueueDeleteBody(getTicket(),
                                                                         queueName,
                                                                         false,
                                                                         false,
                                                                         true);
        AMQFrame queueDeleteFrame = body.generateFrame(_channelId);

        getProtocolHandler().syncWrite(queueDeleteFrame, QueueDeleteOkBody.class);
    }
View Full Code Here

TOP

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

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.