Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.AMQShortString


    }


    public AMQTopic(AMQShortString exchangeName, String routingKey)
    {
        this(exchangeName, new AMQShortString(routingKey));
    }
View Full Code Here


            if (qpidTopic.getDestSyntax() == DestSyntax.ADDR)
            {
                try
                {
                    AMQTopic t = new AMQTopic(qpidTopic.getAddress());
                    AMQShortString queueName = getDurableTopicQueueName(subscriptionName, connection);
                    // link is never null if dest was created using an address string.
                    t.getLink().setName(queueName.asString());              
                    t.getLink().getSubscriptionQueue().setAutoDelete(false);
                    t.getLink().setDurable(true);
                   
                    // The legacy fields are also populated just in case.
                    t.setQueueName(queueName);
View Full Code Here

        }
    }

    public static AMQShortString getDurableTopicQueueName(String subscriptionName, AMQConnection connection) throws JMSException
    {
        return new AMQShortString(connection.getClientID() + ":" + subscriptionName);
    }
View Full Code Here

    @Override
    public AMQShortString getExchangeName()
    {
        if (super.getExchangeName() == null && super.getAddressName() != null)
        {
            return new AMQShortString(super.getAddressName());
        }
        else
        {
            return super.getExchangeName();
        }
View Full Code Here

        {
            return super.getRoutingKey();           
        }
        else if (getSubject() != null)
        {
            return new AMQShortString(getSubject());
        }
        else
        {
            setRoutingKey(new AMQShortString(""));
            setSubject("");
            return super.getRoutingKey();
        }
    }
View Full Code Here

            _url.getOptions().remove(AMQConnectionURL.OPTIONS_FAILOVER);
        }

        if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_DEFAULT_TOPIC_EXCHANGE))
        {
            _url.setDefaultTopicExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_DEFAULT_TOPIC_EXCHANGE)));
        }

        if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_DEFAULT_QUEUE_EXCHANGE))
        {
            _url.setDefaultQueueExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_DEFAULT_QUEUE_EXCHANGE)));
        }

        if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_TEMPORARY_QUEUE_EXCHANGE))
        {
            _url.setTemporaryQueueExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_TEMPORARY_QUEUE_EXCHANGE)));
        }

        if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_TEMPORARY_TOPIC_EXCHANGE))
        {
            _url.setTemporaryTopicExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_TEMPORARY_TOPIC_EXCHANGE)));
        }
    }
View Full Code Here

        AMQDestination dest;

        if (AMQDestination.getDefaultDestSyntax() == AMQDestination.DestSyntax.BURL)
        {
            dest = generateDestination(new AMQShortString(_deliveryProps.getExchange()),
                                   new AMQShortString(_deliveryProps.getRoutingKey()));
        }
        else
        {
            String subject = null;
            if (messageProps != null && messageProps.getApplicationHeaders() != null)
View Full Code Here

                String exchange = replyTo.getExchange();
                String routingKey = replyTo.getRoutingKey();

                if (AMQDestination.getDefaultDestSyntax() == AMQDestination.DestSyntax.BURL)
                {
                    dest = generateDestination(new AMQShortString(exchange), new AMQShortString(routingKey));
                }
                else
                {
                    dest = convertToAddressBasedDestination(exchange,routingKey,null);
                }
View Full Code Here

        try
        {
            AMQDestination dest = (AMQDestination)AMQDestination.createDestination("ADDR:" + addr);
            if (isQueue)
            {
                dest.setQueueName(new AMQShortString(routingKey));
                dest.setRoutingKey(new AMQShortString(routingKey));
                dest.setExchangeName(new AMQShortString(""));
            }
            else
            {
                dest.setRoutingKey(new AMQShortString(routingKey));
                dest.setExchangeName(new AMQShortString(exchange));
            }
            return dest;
        }
        catch(Exception e)
        {
            // An exception is only thrown here if the address syntax is invalid.
            // Logging the exception, but not throwing as this is only important to Qpid developers.
            // An exception here means a bug in the code.
            _logger.error("Exception when constructing an address string from the ReplyTo struct");
           
            // falling back to the old way of doing it to ensure the application continues.
            return generateDestination(new AMQShortString(exchange), new AMQShortString(routingKey));
        }
    }
View Full Code Here

    public AMQShortString subscribeToQueue(AMQShortString tag, AMQQueue queue, boolean acks,
                                           FieldTable filters, boolean noLocal, boolean exclusive) throws AMQException
    {
        if (tag == null)
        {
            tag = new AMQShortString("sgen_" + getNextConsumerTag());
        }

        if (_tag2SubscriptionMap.containsKey(tag))
        {
            throw new AMQException("Consumer already exists with same tag: " + tag);
View Full Code Here

TOP

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

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.