From cc6176cfb9c22ae2cdf56b03d33aca8975b7cd71 Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Wed, 9 Nov 2011 08:58:59 +0000 Subject: QPID-3518: Introduce client side ability to detect server side support. Applied patch from Oleksandr Rudyy and myself. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1199662 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/common/ServerPropertyNames.java | 43 ++++++++++++++++++++++ .../main/java/org/apache/qpid/util/Strings.java | 15 ++++++++ 2 files changed, 58 insertions(+) create mode 100644 java/common/src/main/java/org/apache/qpid/common/ServerPropertyNames.java (limited to 'java/common/src/main') diff --git a/java/common/src/main/java/org/apache/qpid/common/ServerPropertyNames.java b/java/common/src/main/java/org/apache/qpid/common/ServerPropertyNames.java new file mode 100644 index 0000000000..aa262bdde5 --- /dev/null +++ b/java/common/src/main/java/org/apache/qpid/common/ServerPropertyNames.java @@ -0,0 +1,43 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.qpid.common; + +/** + * Keys names used within the serverProperties argument of the ConnectionStart + * method. These property names are Qpid specific. + */ +public final class ServerPropertyNames +{ + /** + * Server property: federation tag UUID + */ + public static final String FEDERATION_TAG = "qpid.federation_tag"; + + /** + * Server property: array of features supported by the server. + */ + public static final String QPID_FEATURES = "qpid.features"; + + /** + * Feature: Signifies that a server supports JMS selectors. + */ + public static final String FEATURE_QPID_JMS_SELECTOR = "qpid.jms-selector"; +} diff --git a/java/common/src/main/java/org/apache/qpid/util/Strings.java b/java/common/src/main/java/org/apache/qpid/util/Strings.java index a6a8b8beb4..fe1a300479 100644 --- a/java/common/src/main/java/org/apache/qpid/util/Strings.java +++ b/java/common/src/main/java/org/apache/qpid/util/Strings.java @@ -257,4 +257,19 @@ public final class Strings return join(sep, Arrays.asList(items)); } + public static String printMap(Map map) + { + StringBuilder sb = new StringBuilder(); + sb.append("<"); + if (map != null) + { + for(String key : map.keySet()) + { + sb.append(key).append(" = ").append(map.get(key)).append(" "); + } + } + sb.append(">"); + return sb.toString(); + } + } -- cgit v1.2.1