summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-03-04 17:18:52 +0000
committerRobert Gemmell <robbie@apache.org>2011-03-04 17:18:52 +0000
commite876fa8c1f7c76a168065839e12a47c8212fc37a (patch)
tree1378a69b1b02861dd324326ef16b0c01522bb08a
parentcd57601d675fb9836b108ccca19ee3e35dcb778d (diff)
downloadqpid-python-e876fa8c1f7c76a168065839e12a47c8212fc37a.tar.gz
QPID-3110: unquote the key values for recieved Notifications to ensure they align with unquoted names used elsewhere in the console
Merged from trunk r1077869. git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.10@1078061 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
index e42b3c53b6..35cc9f6e27 100644
--- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
+++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
@@ -61,7 +61,7 @@ public class NotificationObject
{
if (_source instanceof ObjectName)
{
- return ((ObjectName)_source).getKeyProperty("name");
+ return unquote(((ObjectName)_source).getKeyProperty("name"));
}
return null;
@@ -71,12 +71,31 @@ public class NotificationObject
{
if (_source instanceof ObjectName)
{
- return ((ObjectName)_source).getKeyProperty(VIRTUAL_HOST);
+ return unquote(((ObjectName)_source).getKeyProperty(VIRTUAL_HOST));
}
return null;
}
-
+
+ private String unquote(String value)
+ {
+ if(value != null)
+ {
+ try
+ {
+ //if the value is quoted in the ObjectName, unquote it
+ value = ObjectName.unquote(value);
+ }
+ catch(IllegalArgumentException e)
+ {
+ //ignore, this just means the value is not quoted
+ //and can be left unchanged
+ }
+ }
+
+ return value;
+ }
+
public String getMessage()
{
return _message;