You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2013/07/05 22:59:01 UTC
svn commit: r1500134 - in /qpid/trunk/qpid/java:
bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/
bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/
bdbstore/src/main/java/resources/js/qpid/management/virtualhost/stor...
Author: rgodfrey
Date: Fri Jul 5 20:59:00 2013
New Revision: 1500134
URL: http://svn.apache.org/r1500134
Log:
QPID-4980 : [Java Broker] In HTTP Management make (standard) virtual host store attributes depended upon store type
Added:
qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/
qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/
qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js
qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/
qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/
qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js
- copied, changed from r1500038, qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/memory/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/memory/add.js
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html
- copied, changed from r1500038, qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/memory/
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/memory/add.html
Modified:
qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html
qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java
qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java
qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java
qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java
qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java
qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java
Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java Fri Jul 5 20:59:00 2013
@@ -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 impl
}
+ @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.");
+
+ }
+ }
}
Added: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js?rev=1500134&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js (added)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/store/bdb/add.js Fri Jul 5 20:59:00 2013
@@ -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);
+
+ }});
+ }
+ };
+ });
Added: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html?rev=1500134&view=auto
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html (added)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhost/store/bdb/add.html Fri Jul 5 20:59:00 2013
@@ -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>
Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js Fri Jul 5 20:59:00 2013
@@ -26,11 +26,12 @@ define(["dojo/_base/xhr",
"dojo/parser",
"dojo/_base/array",
"dojo/_base/event",
- 'dojo/_base/json',
+ "dojo/_base/json",
+ "dojo/string",
"dojo/store/Memory",
"dijit/form/FilteringSelect",
"dojo/domReady!"],
- function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect) {
+ function (xhr, dom, construct, win, registry, parser, array, event, json, string, Memory, FilteringSelect) {
return {
show: function() {
var node = dom.byId("addVirtualHost.typeSpecificDiv");
@@ -43,6 +44,17 @@ define(["dojo/_base/xhr",
}
});
+
+ var selectStoreType = function(type) {
+ if(type && string.trim(type) != "") {
+ require(["qpid/management/virtualhost/store/"+type.toLowerCase()+"/add"],
+ function(storeType)
+ {
+ storeType.show();
+ });
+ }
+ }
+
xhr.get({url: "virtualhost/standard/add.html",
sync: true,
load: function(data) {
@@ -70,7 +82,8 @@ define(["dojo/_base/xhr",
that.storeTypeChooser = new FilteringSelect({ id: "addVirtualHost.specific.storeType",
name: "storeType",
store: storeTypesStore,
- searchAttr: "name", required: false}, input);
+ searchAttr: "name", required: false,
+ onChange: selectStoreType }, input);
});
}});
Copied: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js (from r1500038, qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js?p2=qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js&p1=qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js&r1=1500038&r2=1500134&rev=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/standard/addVirtualHost.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js Fri Jul 5 20:59:00 2013
@@ -26,14 +26,15 @@ define(["dojo/_base/xhr",
"dojo/parser",
"dojo/_base/array",
"dojo/_base/event",
- 'dojo/_base/json',
+ "dojo/_base/json",
+ "dojo/string",
"dojo/store/Memory",
"dijit/form/FilteringSelect",
"dojo/domReady!"],
- function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect) {
+ function (xhr, dom, construct, win, registry, parser, array, event, json, string, Memory, FilteringSelect) {
return {
show: function() {
- var node = dom.byId("addVirtualHost.typeSpecificDiv");
+ var node = dom.byId("addVirtualHost.storeSpecificDiv");
var that = this;
array.forEach(registry.toArray(),
@@ -43,35 +44,11 @@ define(["dojo/_base/xhr",
}
});
- xhr.get({url: "virtualhost/standard/add.html",
+ xhr.get({url: "virtualhost/store/derby/add.html",
sync: true,
load: function(data) {
node.innerHTML = data;
parser.parse(node);
- if (that.hasOwnProperty("storeTypeChooser"))
- {
- that.storeTypeChooser.destroy();
- }
- xhr.get({
- sync: true,
- url: "rest/helper?action=ListMessageStoreTypes",
- handleAs: "json"
- }).then(
- function(data) {
- var storeTypes = data;
- var storeTypesData = [];
- for (var i =0 ; i < storeTypes.length; i++)
- {
- storeTypesData[i]= {id: storeTypes[i], name: storeTypes[i]};
- }
- var storeTypesStore = new Memory({ data: storeTypesData });
- var storeTypesDiv = dom.byId("addVirtualHost.specific.selectStoreType");
- var input = construct.create("input", {id: "addStoreType", required: false}, storeTypesDiv);
- that.storeTypeChooser = new FilteringSelect({ id: "addVirtualHost.specific.storeType",
- name: "storeType",
- store: storeTypesStore,
- searchAttr: "name", required: false}, input);
- });
}});
}
Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js?rev=1500134&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/jdbc/add.js Fri Jul 5 20:59:00 2013
@@ -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/jdbc/add.html",
+ sync: true,
+ load: function(data) {
+ node.innerHTML = data;
+ parser.parse(node);
+
+ }});
+ }
+ };
+ });
Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/memory/add.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/memory/add.js?rev=1500134&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/memory/add.js (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/store/memory/add.js Fri Jul 5 20:59:00 2013
@@ -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/memory/add.html",
+ sync: true,
+ load: function(data) {
+ node.innerHTML = data;
+ parser.parse(node);
+
+ }});
+ }
+ };
+ });
Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html Fri Jul 5 20:59:00 2013
@@ -3,11 +3,6 @@
<td class="tableContainer-labelCell" style="width: 300px;"><strong>Store Type*: </strong></td>
<td class="tableContainer-valueCell" ><div id="addVirtualHost.specific.selectStoreType"></div></td>
</tr>
- <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>
+<div id="addVirtualHost.storeSpecificDiv">
+</div>
Copied: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html (from r1500038, qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html?p2=qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html&p1=qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html&r1=1500038&r2=1500134&rev=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/standard/add.html (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/derby/add.html Fri Jul 5 20:59:00 2013
@@ -1,9 +1,5 @@
<table class="tableContainer-table tableContainer-table-horiz">
<tr>
- <td class="tableContainer-labelCell" style="width: 300px;"><strong>Store Type*: </strong></td>
- <td class="tableContainer-valueCell" ><div id="addVirtualHost.specific.selectStoreType"></div></td>
- </tr>
- <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"
Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html?rev=1500134&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html (added)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/jdbc/add.html Fri Jul 5 20:59:00 2013
@@ -0,0 +1,9 @@
+<table class="tableContainer-table tableContainer-table-horiz">
+ <tr>
+ <td class="tableContainer-labelCell" style="width: 300px;"><strong>JDBC Url*: </strong></td>
+ <td class="tableContainer-valueCell">
+ <input dojoType="dijit/form/ValidationTextBox" required="true" id="formAddVirtualHost.specific.connectionURL"
+ name="connectionURL" placeholder="jdbc:provider:info" />
+ </td>
+ </tr>
+</table>
Added: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/memory/add.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/store/memory/add.html?rev=1500134&view=auto
==============================================================================
(empty)
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java Fri Jul 5 20:59:00 2013
@@ -32,4 +32,5 @@ public interface MessageStoreFactory
public Map<String, Object> convertStoreConfiguration(Configuration configuration);
+ void validateAttributes(Map<String, Object> attributes);
}
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java Fri Jul 5 20:59:00 2013
@@ -46,4 +46,8 @@ public class MemoryMessageStoreFactory i
return Collections.emptyMap();
}
+ @Override
+ public void validateAttributes(Map<String, Object> attributes)
+ {
+ }
}
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java Fri Jul 5 20:59:00 2013
@@ -23,6 +23,7 @@ package org.apache.qpid.server.store.der
import java.util.Collections;
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;
@@ -47,4 +48,17 @@ public class DerbyMessageStoreFactory im
return Collections.emptyMap();
}
+
+ @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.");
+
+ }
+ }
+
}
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java Fri Jul 5 20:59:00 2013
@@ -50,6 +50,7 @@ public class JDBCMessageStore extends Ab
public static final String TYPE = "JDBC";
+ public static final String CONNECTION_URL = "connectionURL";
protected String _connectionURL;
private ConnectionProvider _connectionProvider;
@@ -280,9 +281,9 @@ public class JDBCMessageStore extends Ab
{
- String connectionURL = virtualHost.getAttribute("connectionURL") == null
+ String connectionURL = virtualHost.getAttribute(CONNECTION_URL) == null
? String.valueOf(virtualHost.getAttribute(VirtualHost.STORE_PATH))
- : String.valueOf(virtualHost.getAttribute("connectionURL"));
+ : String.valueOf(virtualHost.getAttribute(CONNECTION_URL));
JDBCDetails details = null;
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java Fri Jul 5 20:59:00 2013
@@ -23,6 +23,7 @@ package org.apache.qpid.server.store.jdb
import java.util.HashMap;
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;
@@ -62,4 +63,21 @@ public class JDBCMessageStoreFactory imp
return convertedMap;
}
+
+ @Override
+ public void validateAttributes(Map<String, Object> attributes)
+ {
+ Object connectionURL = attributes.get(JDBCMessageStore.CONNECTION_URL);
+ if(!(connectionURL instanceof String))
+ {
+ Object storePath = attributes.get(VirtualHost.STORE_PATH);
+ if(!(storePath instanceof String))
+ {
+ throw new IllegalArgumentException("Attribute '"+ JDBCMessageStore.CONNECTION_URL
+ +"' is required and must be of type String.");
+
+ }
+ }
+ }
+
}
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java Fri Jul 5 20:59:00 2013
@@ -58,8 +58,8 @@ public class StandardVirtualHostFactory
}
- private static final String STORE_TYPE_ATTRIBUTE = org.apache.qpid.server.model.VirtualHost.STORE_TYPE;
- private static final String STORE_PATH_ATTRIBUTE = org.apache.qpid.server.model.VirtualHost.STORE_PATH;
+ public static final String STORE_TYPE_ATTRIBUTE = org.apache.qpid.server.model.VirtualHost.STORE_TYPE;
+ public static final String STORE_PATH_ATTRIBUTE = org.apache.qpid.server.model.VirtualHost.STORE_PATH;
@Override
public void validateAttributes(Map<String, Object> attributes)
@@ -82,16 +82,23 @@ public class StandardVirtualHostFactory
}
+ for(MessageStoreFactory factory : storeCreator.getFactories())
+ {
+ if(factory.getType().equalsIgnoreCase((String)storeType))
+ {
+ factory.validateAttributes(attributes);
+ }
+ }
// TODO - each store type should validate its own attributes
if(!((String) storeType).equalsIgnoreCase(MemoryMessageStore.TYPE))
{
- Object storePath = attributes.get(STORE_PATH_ATTRIBUTE);
+ /* Object storePath = attributes.get(STORE_PATH_ATTRIBUTE);
if(!(storePath instanceof String))
{
throw new IllegalArgumentException("Attribute '"+ STORE_PATH_ATTRIBUTE
+"' is required and must be of type String.");
- }
+ }*/
}
}
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java?rev=1500134&r1=1500133&r2=1500134&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java Fri Jul 5 20:59:00 2013
@@ -75,4 +75,9 @@ public class SlowMessageStoreFactory imp
return convertedMap;
}
+
+ @Override
+ public void validateAttributes(Map<String, Object> attributes)
+ {
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org