From 6d6bdcbadc22531fbc97d8edf4341b0ec9f4b388 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 22 Sep 2010 01:40:37 +0000 Subject: QPID-2882 Modified the address helper class to check for the durable property in the node props for the target node and link props for the subscription queue. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@999718 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/client/messaging/address/AddressHelper.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'qpid/java/client') diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java b/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java index 0aa2257126..64d5b16db0 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/messaging/address/AddressHelper.java @@ -217,11 +217,7 @@ public class AddressHelper private void fillInCommonNodeArgs(Node node, Map parent, MapAccessor argsMap) { - if (nodeProps != null) - { - node.setDurable(nodeProps.getBoolean(DURABLE) == null ? false - : nodeProps.getBoolean(DURABLE)); - } + node.setDurable(getDurability(parent)); node.setAutoDelete(argsMap.getBoolean(AUTO_DELETE) == null ? false : argsMap.getBoolean(AUTO_DELETE)); node.setAlternateExchange(argsMap.getString(ALT_EXCHANGE)); @@ -231,6 +227,18 @@ public class AddressHelper node.setDeclareArgs((Map)getDeclareArgs(parent).get(ARGUMENTS)); } } + + private boolean getDurability(Map map) + { + if (map != null && map.get(DURABLE) != null) + { + return Boolean.parseBoolean((String)map.get(DURABLE)); + } + else + { + return false; + } + } /** * if the type == queue x-declare args from the node props is used. if the -- cgit v1.2.1