Package org.apache.qpid.client.messaging.address

Examples of org.apache.qpid.client.messaging.address.Link$Subscription


        }
    }

    void createSubscriptionQueue(AMQDestination dest, boolean noLocal, String messageSelector) throws AMQException
    {
        Link link = dest.getLink();
        String queueName = dest.getQueueName();

        if (queueName == null)
        {
            queueName = link.getName() == null ? "TempQueue" + UUID.randomUUID() : link.getName();
            dest.setQueueName(new AMQShortString(queueName));
        }

        SubscriptionQueue queueProps = link.getSubscriptionQueue();
        Map<String,Object> arguments = queueProps.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }

        if (link.isDurable() && queueName.startsWith("TempQueue"))
        {
            throw new AMQException("You cannot mark a subscription queue as durable without providing a name for the link.");
        }

        getQpidSession().queueDeclare(queueName,
                queueProps.getAlternateExchange(), arguments,
                queueProps.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                link.isDurable() ? Option.DURABLE : Option.NONE,
                queueProps.isExclusive() ? Option.EXCLUSIVE : Option.NONE);

        Map<String,Object> bindingArguments = new HashMap<String, Object>();
        bindingArguments.put(AMQPFilterTypes.JMS_SELECTOR.getValue().toString(), messageSelector == null ? "" : messageSelector);
        getQpidSession().exchangeBind(queueName,
View Full Code Here


        AMQDestination destination = consumer.getDestination();
        long capacity = consumer.getCapacity();

        Map<String, Object> arguments = FieldTable.convertToMap(consumer.getArguments());

        Link link = destination.getLink();
        if (link != null && link.getSubscription() != null && link.getSubscription().getArgs() != null)
        {
            arguments.putAll((Map<? extends String, ? extends Object>) link.getSubscription().getArgs());
        }

        boolean acceptModeNone = getAcknowledgeMode() == NO_ACKNOWLEDGE;

        getQpidSession().messageSubscribe
View Full Code Here

    }

    @Override
    void createSubscriptionQueue(AMQDestination dest, boolean noLocal, String messageSelector) throws AMQException
    {
        Link link = dest.getLink();
        String queueName = dest.getQueueName();

        if (queueName == null)
        {
            queueName = link.getName() == null ? "TempQueue" + UUID.randomUUID() : link.getName();
            dest.setQueueName(new AMQShortString(queueName));
        }

        SubscriptionQueue queueProps = link.getSubscriptionQueue();
        Map<String,Object> arguments = queueProps.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }

        if (link.isDurable() && queueName.startsWith("TempQueue"))
        {
            throw new AMQException("You cannot mark a subscription queue as durable without providing a name for the link.");
        }

        getQpidSession().queueDeclare(queueName,
                queueProps.getAlternateExchange(), arguments,
                queueProps.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                link.isDurable() ? Option.DURABLE : Option.NONE,
                queueProps.isExclusive() ? Option.EXCLUSIVE : Option.NONE);

        Map<String,Object> bindingArguments = new HashMap<String, Object>();
        bindingArguments.put(AMQPFilterTypes.JMS_SELECTOR.getValue().toString(), messageSelector == null ? "" : messageSelector);
        getQpidSession().exchangeBind(queueName,
View Full Code Here

    }

    @Override
    void createSubscriptionQueue(AMQDestination dest, boolean noLocal, String messageSelector) throws AMQException
    {
        final Link link = dest.getLink();
        final String queueName ;

        if (dest.getQueueName() == null)
        {
            queueName = link.getName() == null ? "TempQueue" + UUID.randomUUID() : link.getName();
            dest.setQueueName(new AMQShortString(queueName));
        }
        else
        {
            queueName = dest.getQueueName();
        }

        final Link.SubscriptionQueue queueProps = link.getSubscriptionQueue();
        final Map<String,Object> arguments = queueProps.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }

        if (link.isDurable() && queueName.startsWith("TempQueue"))
        {
            throw new AMQException("You cannot mark a subscription queue as durable without providing a name for the link.");
        }

        (new FailoverNoopSupport<Void, AMQException>(
                new FailoverProtectedOperation<Void, AMQException>()
                {
                    public Void execute() throws AMQException, FailoverException
                    {

                        // not setting alternate exchange
                        sendQueueDeclare(AMQShortString.valueOf(queueName),
                                         link.isDurable(),
                                         queueProps.isExclusive(),
                                         queueProps.isAutoDelete(),
                                         FieldTable.convertToFieldTable(arguments),
                                         false);
View Full Code Here

        AMQDestination destination = consumer.getDestination();
        long capacity = consumer.getCapacity();

        Map<String, Object> arguments = FieldTable.convertToMap(consumer.getArguments());

        Link link = destination.getLink();
        if (link != null && link.getSubscription() != null && link.getSubscription().getArgs() != null)
        {
            arguments.putAll((Map<? extends String, ? extends Object>) link.getSubscription().getArgs());
        }

        boolean acceptModeNone = getAcknowledgeMode() == NO_ACKNOWLEDGE;

        getQpidSession().messageSubscribe
View Full Code Here

        AMQDestination destination = consumer.getDestination();
        long capacity = consumer.getCapacity();

        Map<String, Object> arguments = FieldTable.convertToMap(consumer.getArguments());

        Link link = destination.getLink();
        if (link != null && link.getSubscription() != null && link.getSubscription().getArgs() != null)
        {
            arguments.putAll(link.getSubscription().getArgs());
        }

        boolean acceptModeNone = getAcknowledgeMode() == NO_ACKNOWLEDGE;

        String queue = queueName == null ? destination.getAddressName() : queueName.toString();
View Full Code Here

    }

    @Override
    void createSubscriptionQueue(AMQDestination dest, boolean noLocal, String messageSelector) throws AMQException
    {
        Link link = dest.getLink();
        String queueName = dest.getQueueName();

        if (queueName == null)
        {
            queueName = link.getName() == null ? "TempQueue" + UUID.randomUUID() : link.getName();
            dest.setQueueName(new AMQShortString(queueName));
        }

        SubscriptionQueue queueProps = link.getSubscriptionQueue();
        Map<String,Object> arguments = queueProps.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }

        if (link.isDurable() && queueName.startsWith("TempQueue"))
        {
            throw new AMQException("You cannot mark a subscription queue as durable without providing a name for the link.");
        }

        getQpidSession().queueDeclare(queueName,
                queueProps.getAlternateExchange(), arguments,
                queueProps.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                link.isDurable() ? Option.DURABLE : Option.NONE,
                queueProps.isExclusive() ? Option.EXCLUSIVE : Option.NONE);

        Map<String,Object> bindingArguments = new HashMap<String, Object>();
        bindingArguments.put(AMQPFilterTypes.JMS_SELECTOR.getValue().toString(), messageSelector == null ? "" : messageSelector);
        getQpidSession().exchangeBind(queueName,
View Full Code Here

        AMQDestination destination = consumer.getDestination();

        Map<String, Object> arguments = FieldTable.convertToMap(consumer.getArguments());

        Link link = destination.getLink();
        if (link != null && link.getSubscription() != null && link.getSubscription().getArgs() != null)
        {
            arguments.putAll(link.getSubscription().getArgs());
        }

        BasicConsumeBody body = getMethodRegistry().createBasicConsumeBody(getTicket(),
                                                                           queueName,
                                                                           new AMQShortString(String.valueOf(tag)),
View Full Code Here

    }

    @Override
    void createSubscriptionQueue(AMQDestination dest, boolean noLocal, String messageSelector) throws AMQException
    {
        final Link link = dest.getLink();
        final String queueName ;

        if (dest.getQueueName() == null)
        {
            queueName = link.getName() == null ? "TempQueue" + UUID.randomUUID() : link.getName();
            dest.setQueueName(new AMQShortString(queueName));
        }
        else
        {
            queueName = dest.getQueueName();
        }

        final Link.SubscriptionQueue queueProps = link.getSubscriptionQueue();
        final Map<String,Object> arguments = queueProps.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }

        if (link.isDurable() && queueName.startsWith("TempQueue"))
        {
            throw new AMQException("You cannot mark a subscription queue as durable without providing a name for the link.");
        }

        (new FailoverNoopSupport<Void, AMQException>(
                new FailoverProtectedOperation<Void, AMQException>()
                {
                    public Void execute() throws AMQException, FailoverException
                    {

                        // not setting alternate exchange
                        sendQueueDeclare(AMQShortString.valueOf(queueName),
                                         link.isDurable(),
                                         queueProps.isExclusive(),
                                         queueProps.isAutoDelete(),
                                         FieldTable.convertToFieldTable(arguments),
                                         false);
View Full Code Here

    }

    public Object createObject(Attributes attributes) {
        String host = attributes.getValue("host");
        User user = (User) digester.peek();
        Subscription subscription = user.createSubscription(host);
        String autoConnect = attributes.getValue("autoConnect");
        if (autoConnect == null) {
            autoConnect = "false";
        }
        if ("true".equalsIgnoreCase(autoConnect) ||
            "yes".equalsIgnoreCase(autoConnect)) {
            subscription.setAutoConnect(true);
        } else {
            subscription.setAutoConnect(false);
        }
        subscription.setPassword(attributes.getValue("password"));
        subscription.setType(attributes.getValue("type"));
        subscription.setUsername(attributes.getValue("username"));
        return (subscription);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.messaging.address.Link$Subscription

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.