summaryrefslogtreecommitdiff
path: root/qpid/java/bdbstore/src
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2013-07-05 20:59:00 +0000
committerRobert Godfrey <rgodfrey@apache.org>2013-07-05 20:59:00 +0000
commit79e8440bdaac4a4dd764ace6b81cd300717c7d67 (patch)
tree72be60d2fdd1e78dd4b7d707ac78befddf5efec0 /qpid/java/bdbstore/src
parent88c521cc70189673c259cbccd2f7ea7732a8588a (diff)
downloadqpid-python-79e8440bdaac4a4dd764ace6b81cd300717c7d67.tar.gz
QPID-4980 : [Java Broker] In HTTP Management make (standard) virtual host store attributes depended upon store type
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1500134 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/bdbstore/src')
-rw-r--r--qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java12
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js56
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html9
3 files changed, 77 insertions, 0 deletions
diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
index 4d224ab86e..4eac54dd6f 100644
--- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
+++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.configuration.Configuration;
+import org.apache.qpid.server.model.VirtualHost;
import org.apache.qpid.server.plugin.MessageStoreFactory;
import org.apache.qpid.server.store.MessageStore;
@@ -72,4 +73,15 @@ public class BDBMessageStoreFactory implements MessageStoreFactory
}
+ @Override
+ public void validateAttributes(Map<String, Object> attributes)
+ {
+ Object storePath = attributes.get(VirtualHost.STORE_PATH);
+ if(!(storePath instanceof String))
+ {
+ throw new IllegalArgumentException("Attribute '"+ VirtualHost.STORE_PATH
+ +"' is required and must be of type String.");
+
+ }
+ }
}
diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js
new file mode 100644
index 0000000000..b86a2c73d4
--- /dev/null
+++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js
@@ -0,0 +1,56 @@
+/*
+ *
+ * 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.
+ *
+ */
+define(["dojo/_base/xhr",
+ "dojo/dom",
+ "dojo/dom-construct",
+ "dojo/_base/window",
+ "dijit/registry",
+ "dojo/parser",
+ "dojo/_base/array",
+ "dojo/_base/event",
+ "dojo/_base/json",
+ "dojo/string",
+ "dojo/store/Memory",
+ "dijit/form/FilteringSelect",
+ "dojo/domReady!"],
+ function (xhr, dom, construct, win, registry, parser, array, event, json, string, Memory, FilteringSelect) {
+ return {
+ show: function() {
+ var node = dom.byId("addVirtualHost.storeSpecificDiv");
+ var that = this;
+
+ array.forEach(registry.toArray(),
+ function(item) {
+ if(item.id.substr(0,27) == "formAddVirtualHost.specific") {
+ item.destroyRecursive();
+ }
+ });
+
+ xhr.get({url: "virtualhost/store/bdb/add.html",
+ sync: true,
+ load: function(data) {
+ node.innerHTML = data;
+ parser.parse(node);
+
+ }});
+ }
+ };
+ });
diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html b/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html
new file mode 100644
index 0000000000..9424612e3c
--- /dev/null
+++ b/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html
@@ -0,0 +1,9 @@
+<table class="tableContainer-table tableContainer-table-horiz">
+ <tr>
+ <td class="tableContainer-labelCell" style="width: 300px;"><strong>Path to store location*: </strong></td>
+ <td class="tableContainer-valueCell">
+ <input dojoType="dijit/form/ValidationTextBox" required="true" id="formAddVirtualHost.specific.storePath"
+ name="storePath" placeholder="/path/to/message/store" />
+ </td>
+ </tr>
+</table>