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

Examples of org.apache.qpid.client.messaging.address.Node


                                          passive ? Option.PASSIVE : Option.NONE);
        }
        else
        {
            // This code is here to ensure address based destination work with the declareQueue public method in AMQSession.java
            Node node = amqd.getNode();
            Map<String,Object> arguments = new HashMap<String,Object>();
            arguments.putAll((Map<? extends String, ? extends Object>) node.getDeclareArgs());
            if (arguments == null || arguments.get(AddressHelper.NO_LOCAL) == null)
            {
                arguments.put(AddressHelper.NO_LOCAL, noLocal);
            }
            getQpidSession().queueDeclare(queueName.toString(), node.getAlternateExchange() ,
                    arguments,
                    node.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                    node.isDurable() ? Option.DURABLE : Option.NONE,
                    node.isExclusive() ? Option.EXCLUSIVE : Option.NONE);
        }

        // passive --> false
        if (!nowait)
        {
View Full Code Here


    public boolean isExchangeExist(AMQDestination dest,boolean assertNode) throws AMQException
    {
        boolean match = true;
        ExchangeQueryResult result = getQpidSession().exchangeQuery(dest.getAddressName(), Option.NONE).get();
        match = !result.getNotFound();
        Node node = dest.getNode();

        if (match)
        {
            if (assertNode)
            {
                match =  (result.getDurable() == node.isDurable()) &&
                         (node.getExchangeType() != null &&
                          node.getExchangeType().equals(result.getType())) &&
                         (matchProps(result.getArguments(),node.getDeclareArgs()));
            }
            else
            {
                _logger.debug("Setting Exchange type " + result.getType());
                node.setExchangeType(result.getType());
                dest.setExchangeClass(new AMQShortString(result.getType()));
            }
        }

        if (assertNode)
View Full Code Here

        boolean match = true;
        try
        {
            QueueQueryResult result = getQpidSession().queueQuery(dest.getAddressName(), Option.NONE).get();
            match = dest.getAddressName().equals(result.getQueue());
            Node node = dest.getNode();

            if (match && assertNode)
            {
                match = (result.getDurable() == node.isDurable()) &&
                         (result.getAutoDelete() == node.isAutoDelete()) &&
                         (result.getExclusive() == node.isExclusive()) &&
                         (matchProps(result.getArguments(),node.getDeclareArgs()));
            }

            if (assertNode)
            {
                if (!match)
View Full Code Here

    public void setLegacyFiledsForTopicType(AMQDestination dest)
    {
        // legacy support
        dest.setExchangeName(new AMQShortString(dest.getAddressName()));
        Node node = dest.getNode();
        dest.setExchangeClass(node.getExchangeType() == null?
                              AMQShortString.valueOf(ExchangeDefaults.TOPIC_EXCHANGE_CLASS):
                              new AMQShortString(node.getExchangeType()));
        dest.setRoutingKey(new AMQShortString(dest.getSubject()));
    }
View Full Code Here

        }
    }

    private void handleQueueNodeCreation(AMQDestination dest, boolean noLocal) throws AMQException
    {
        Node node = dest.getNode();
        Map<String,Object> arguments = node.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }
        getQpidSession().queueDeclare(dest.getAddressName(),
                node.getAlternateExchange(), arguments,
                node.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                node.isDurable() ? Option.DURABLE : Option.NONE,
                node.isExclusive() ? Option.EXCLUSIVE : Option.NONE);

        createBindings(dest, dest.getNode().getBindings());
        sync();
    }
View Full Code Here

                                          passive ? Option.PASSIVE : Option.NONE);
        }
        else
        {
            // This code is here to ensure address based destination work with the declareQueue public method in AMQSession.java
            Node node = amqd.getNode();
            Map<String,Object> arguments = new HashMap<String,Object>();
            arguments.putAll((Map<? extends String, ? extends Object>) node.getDeclareArgs());
            if (arguments == null || arguments.get(AddressHelper.NO_LOCAL) == null)
            {
                arguments.put(AddressHelper.NO_LOCAL, noLocal);
            }
            getQpidSession().queueDeclare(queueName.toString(), node.getAlternateExchange() ,
                    arguments,
                    node.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                    node.isDurable() ? Option.DURABLE : Option.NONE,
                    node.isExclusive() ? Option.EXCLUSIVE : Option.NONE);  
        }

        // passive --> false
        if (!nowait)
        {
View Full Code Here

    public boolean isExchangeExist(AMQDestination dest,boolean assertNode)
    {
        boolean match = true;
        ExchangeQueryResult result = getQpidSession().exchangeQuery(dest.getAddressName(), Option.NONE).get();
        match = !result.getNotFound();       
        Node node = dest.getNode();
       
        if (match)
        {
            if (assertNode)
            {
                match =  (result.getDurable() == node.isDurable()) &&
                         (node.getExchangeType() != null &&
                          node.getExchangeType().equals(result.getType())) &&
                         (matchProps(result.getArguments(),node.getDeclareArgs()));
            }
            else
            {
                _logger.debug("Setting Exchange type " + result.getType());
                node.setExchangeType(result.getType());
                dest.setExchangeClass(new AMQShortString(result.getType()));
            }
        }
        return match;
    }
View Full Code Here

        boolean match = true;
        try
        {
            QueueQueryResult result = getQpidSession().queueQuery(dest.getAddressName(), Option.NONE).get();
            match = dest.getAddressName().equals(result.getQueue());
            Node node = dest.getNode();

            if (match && assertNode)
            {
                match = (result.getDurable() == node.isDurable()) &&
                         (result.getAutoDelete() == node.isAutoDelete()) &&
                         (result.getExclusive() == node.isExclusive()) &&
                         (matchProps(result.getArguments(),node.getDeclareArgs()));
            }
            else if (match)
            {
                // should I use the queried details to update the local data structure.
            }
View Full Code Here

    public void setLegacyFiledsForTopicType(AMQDestination dest)
    {
        // legacy support
        dest.setExchangeName(new AMQShortString(dest.getAddressName()));
        Node node = dest.getNode();
        dest.setExchangeClass(node.getExchangeType() == null?
                              ExchangeDefaults.TOPIC_EXCHANGE_CLASS:
                              new AMQShortString(node.getExchangeType()))
        dest.setRoutingKey(new AMQShortString(dest.getSubject()));
    }
View Full Code Here

        }
    }

    private void handleQueueNodeCreation(AMQDestination dest, boolean noLocal) throws AMQException
    {
        Node node = dest.getNode();
        Map<String,Object> arguments = node.getDeclareArgs();
        if (!arguments.containsKey((AddressHelper.NO_LOCAL)))
        {
            arguments.put(AddressHelper.NO_LOCAL, noLocal);
        }
        getQpidSession().queueDeclare(dest.getAddressName(),
                node.getAlternateExchange(), arguments,
                node.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
                node.isDurable() ? Option.DURABLE : Option.NONE,
                node.isExclusive() ? Option.EXCLUSIVE : Option.NONE);

        createBindings(dest, dest.getNode().getBindings());
        sync();
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.messaging.address.Node

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.