diff options
| author | Andrew MacBean <macbean@apache.org> | 2014-07-25 16:16:12 +0000 |
|---|---|---|
| committer | Andrew MacBean <macbean@apache.org> | 2014-07-25 16:16:12 +0000 |
| commit | 151622bd91d7eb031498ff598a31a295af27799b (patch) | |
| tree | 37c36b0b878866689603d6c85da3a217d6125d2d /qpid/java | |
| parent | 6b02c4c08fdc26de6e048357111d9e0b85ab4927 (diff) | |
| download | qpid-python-151622bd91d7eb031498ff598a31a295af27799b.tar.gz | |
QPID-5928: [Java Broker] Implement or update virtualhostnode & virtualhost
Work completed by Alex Rudyy <orudyy@apache.org> and me.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1613461 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
39 files changed, 1237 insertions, 386 deletions
diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb/show.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb/show.js new file mode 100644 index 0000000000..d7e84aa6a4 --- /dev/null +++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb/show.js @@ -0,0 +1,38 @@ +/* + * 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(["qpid/common/util", + "dojo/domReady!"], + function (util) + { + var fields = ["storePath", "storeUnderfullSize", "storeOverfullSize"]; + + function BDB(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhost/sizemonitoring/show.html", fields, this); + } + + BDB.prototype.update = function(data) + { + util.updateUI(data, fields, this); + } + + return BDB; + } +); diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js new file mode 100644 index 0000000000..d95d223e2d --- /dev/null +++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js @@ -0,0 +1,69 @@ +/* + * 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(["qpid/common/util", "dojo/query", "dojo/domReady!"], + function (util, query) + { + var fields = [ "storeUnderfullSize", "storeOverfullSize", "permittedNodes"]; + var syncPolicies = ["sync", "no_sync", "write_no_sync"]; + var localTransactionSynchronizationPolicy = "localTransactionSynchronizationPolicy"; + var remoteTransactionSynchronizationPolicy = "remoteTransactionSynchronizationPolicy"; + + function BDB(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhost/bdb_ha/show.html", fields, this); + for(var i=0; i<syncPolicies.length;i++) + { + var policyName = syncPolicies[i]; + this[localTransactionSynchronizationPolicy + "-" + policyName]= query("." + localTransactionSynchronizationPolicy + "-" + policyName, data.containerNode)[0]; + this[remoteTransactionSynchronizationPolicy +"-" + policyName]= query("." + remoteTransactionSynchronizationPolicy + "-" + policyName, data.containerNode)[0]; + } + } + + BDB.prototype.update = function(data) + { + util.updateUI(data, fields, this); + var localSyncPolicy = data[localTransactionSynchronizationPolicy].toLowerCase(); + var remoteSyncPolicy = data[remoteTransactionSynchronizationPolicy].toLowerCase(); + for(var i=0; i<syncPolicies.length;i++) + { + var policyName = syncPolicies[i]; + if (policyName==localSyncPolicy) + { + this[localTransactionSynchronizationPolicy + "-" + policyName].checked = true + } + else + { + this[localTransactionSynchronizationPolicy + "-" + policyName].checked = false + } + + if (policyName==remoteSyncPolicy) + { + this[remoteTransactionSynchronizationPolicy + "-" + policyName].checked = true + } + else + { + this[remoteTransactionSynchronizationPolicy + "-" + policyName].checked = false + } + } + } + + return BDB; + } +); diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js index b38d7eddc0..b7f29f9469 100644 --- a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js +++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js @@ -18,65 +18,19 @@ * under the License. * */ -define(["dojo/_base/xhr", - "dojo/_base/lang", - "dojo/_base/connect", - "dojo/parser", - "dojo/string", - "dojox/html/entities", - "dojo/query", - "dojo/json", - "dijit/registry", - "qpid/common/UpdatableStore", - "dojo/domReady!"], - function (xhr, lang, connect, parser, json, entities, query, json, registry, UpdatableStore) +define(["qpid/common/util", "dojo/domReady!"], + function (util) { + var fieldNames = ["storePath"]; + function BdbNode(data) { - var containerNode = data.containerNode; - this.parent = data.parent; - var that = this; - xhr.get({url: "virtualhostnode/bdb/show.html", - sync: true, - load: function(template) { - containerNode.innerHTML = template; - parser.parse(containerNode); - }}); - this.storePath = query(".storePath", containerNode)[0]; - this.environmentConfigurationPanel = registry.byNode(query(".environmentConfigurationPanel", containerNode)[0]); - this.environmentConfigurationGrid = new UpdatableStore([], - query(".environmentConfiguration", containerNode)[0], - [ {name: 'Name', field: 'id', width: '50%'}, {name: 'Value', field: 'value', width: '50%'} ], - null, - null, - null, true ); + util.buildUI(data.containerNode, data.parent, "virtualhostnode/bdb/show.html", fieldNames, this); } BdbNode.prototype.update=function(data) { - this.storePath.innerHTML = entities.encode(String(data.storePath)); - if (data.environmentConfiguration) - { - this.environmentConfigurationPanel.domNode.style.display="block"; - var conf = data.environmentConfiguration; - var settings = []; - for(var propName in conf) - { - if(conf.hasOwnProperty(propName)) - { - settings.push({"id": propName, "value": conf[propName]}); - } - } - var changed = this.environmentConfigurationGrid.update(settings); - if (changed) - { - this.environmentConfigurationGrid.grid._refresh(); - } - } - else - { - this.environmentConfigurationPanel.domNode.style.display="none"; - } + util.updateUI(data, fieldNames, this); }; return BdbNode; diff --git a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js index de558048a0..43cb2a1992 100644 --- a/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js +++ b/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js @@ -19,10 +19,7 @@ * */ define(["dojo/_base/xhr", - "dojo/_base/lang", "dojo/_base/connect", - "dojo/parser", - "dojo/string", "dojox/html/entities", "dojo/query", "dojo/json", @@ -31,11 +28,12 @@ define(["dojo/_base/xhr", "qpid/common/UpdatableStore", "qpid/management/UserPreferences", "qpid/management/virtualhostnode/bdb_ha/edit", + "qpid/common/util", "dojo/domReady!"], - function (xhr, lang, connect, parser, json, entities, query, json, registry, EnhancedGrid, UpdatableStore, UserPreferences, edit) + function (xhr, connect, entities, query, json, registry, EnhancedGrid, UpdatableStore, UserPreferences, edit, util) { var priorityNames = {'_0': 'Never', '_1': 'Default', '_2': 'Normal', '_3': 'High'}; - var nodeFields = ["storePath", "groupName", "role", "address", "designatedPrimary", "durability", "priority", "quorumOverride"]; + var nodeFields = ["storePath", "groupName", "role", "address", "designatedPrimary", "priority", "quorumOverride"]; function findNode(nodeClass, containerNode) { @@ -88,36 +86,11 @@ define(["dojo/_base/xhr", var containerNode = data.containerNode; this.parent = data.parent; var that = this; - xhr.get({url: "virtualhostnode/bdb_ha/show.html", - sync: true, - load: function(template) { - containerNode.innerHTML = template; - parser.parse(containerNode); - }}); - - for(var i=0; i<nodeFields.length;i++) - { - var fieldName = nodeFields[i]; - this[fieldName]= findNode(fieldName, containerNode); - } + util.buildUI(data.containerNode, data.parent, "virtualhostnode/bdb_ha/show.html", nodeFields, this); this.designatedPrimaryContainer = findNode("designatedPrimaryContainer", containerNode); this.priorityContainer = findNode("priorityContainer", containerNode); this.quorumOverrideContainer = findNode("quorumOverrideContainer", containerNode); - this.environmentConfigurationPanel = registry.byNode(query(".environmentConfigurationPanel", containerNode)[0]), - this.environmentConfigurationGrid = new UpdatableStore([], - query(".environmentConfiguration", containerNode)[0], - [ {name: 'Name', field: 'id', width: '50%'}, {name: 'Value', field: 'value', width: '50%'} ], - null, - null, - null, true ); - this.replicatedEnvironmentConfigurationPanel = registry.byNode(query(".replicatedEnvironmentConfigurationPanel", containerNode)[0]); - this.replicatedEnvironmentConfigurationGrid = new UpdatableStore([], - query(".replicatedEnvironmentConfiguration", containerNode)[0], - [ {name: 'Name', field: 'id', width: '50%'}, {name: 'Value', field: 'value', width: '50%'} ], - null, - null, - null, true ); this.membersGridPanel = registry.byNode(query(".membersGridPanel", containerNode)[0]); this.membersGrid = new UpdatableStore([], @@ -182,6 +155,7 @@ define(["dojo/_base/xhr", } ); this.parent.editNodeButton.set("disabled", false); + this.parent.editNodeButton.domNode.style.display = "inline"; this.parent.editNodeButton.on("click", function(e) { @@ -210,9 +184,6 @@ define(["dojo/_base/xhr", } } - this._updateGrid(this._convertConfig(data.environmentConfiguration), this.environmentConfigurationPanel, this.environmentConfigurationGrid ); - this._updateGrid(this._convertConfig(data.replicatedEnvironmentConfiguration), this.replicatedEnvironmentConfigurationPanel, this.replicatedEnvironmentConfigurationGrid ); - var members = data.remotereplicationnodes; if (members) { @@ -259,20 +230,5 @@ define(["dojo/_base/xhr", } } - BDBHA.prototype._convertConfig=function(conf) - { - var settings = []; - if (conf) - { - for(var propName in conf) - { - if(conf.hasOwnProperty(propName)) - { - settings.push({"id": propName, "value": conf[propName]}); - } - } - } - return settings; - } return BDBHA; }); diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/show.html b/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/show.html new file mode 100644 index 0000000000..97738fbb92 --- /dev/null +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/show.html @@ -0,0 +1,75 @@ +<!-- + ~ 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. + --> + +<div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Overfull Limit:</div> + <div style="float:left;"><span class="storeOverfullSize" ></span> bytes</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Underfull Limit:</div> + <div style="float:left;"><span class="storeUnderfullSize"></span> bytes</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Permitted Nodes:</div> + <div class="permittedNodes" style="float:left;"></div> + </div> + <div style="clear:both"></div> + <br/> + + <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'High Availability Durability', open: true"> + <div>Before each transaction commit returns to the caller the following will be true:</div> + <div> + <div>At the master node, the node will have received the required minimum number of acknowledgements from the replica nodes and the transaction will have been:</div> + <div> + <input type="radio" disabled="true" class="localTransactionSynchronizationPolicy-sync" name="localTransactionSynchronizationPolicy" value="SYNC"/> + <label>written and synchronized to the disk [default - highest durability],</label> + </div> + + <div> + <input type="radio" disabled="true" class="localTransactionSynchronizationPolicy-write_no_sync" name="localTransactionSynchronizationPolicy" value="WRITE_NO_SYNC"/> + <label>written only; the synchronization will be performed later,</label> + </div> + + <div> + <input type="radio" class="localTransactionSynchronizationPolicy-no_sync" disabled="true" name="localTransactionSynchronizationPolicy" value="NO_SYNC"/> + <label>write later; the transaction will be written and synchronized later [lowest durability],</label> + </div> + </div> + <div> + <div>At the required minimum number od replica nodes, the transaction will have been:</div> + <div> + <input type="radio" disabled="true" class="remoteTransactionSynchronizationPolicy-sync" name="remoteTransactionSynchronizationPolicy" value="SYNC"/> + <label>written and synchronized to the disk [default - highest durability],</label> + </div> + + <div> + <input type="radio" disabled="true" class="remoteTransactionSynchronizationPolicy-write_no_sync" name="remoteTransactionSynchronizationPolicy" value="WRITE_NO_SYNC"/> + <label>written only; the synchronization will be performed later,</label> + </div> + + <div> + <input type="radio" class="remoteTransactionSynchronizationPolicy-no_sync" disabled="true" name="remoteTransactionSynchronizationPolicy" value="NO_SYNC"/> + <label>write later; the transaction will be written and synchronized later [lowest durability],</label> + </div> + </div> + </div> + + +</div> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/show.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/show.html index cdf96c3fb8..b1e4a34d96 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/show.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/show.html @@ -20,7 +20,4 @@ <div class="storePath" style="float:left;"></div> </div> <div style="clear:both"></div> - <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Environment Configuration', open: true" class="environmentConfigurationPanel"> - <div class="environmentConfiguration"></div> - </div> -</div>
\ No newline at end of file +</div> diff --git a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html index c37fa87922..46894bdfd3 100644 --- a/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html +++ b/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html @@ -35,10 +35,6 @@ <div class="formLabel-labelCell" style="float:left; width: 200px;">Address:</div> <div class="address" style="float:left;">N/A</div> </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Durability:</div> - <div class="durability" style="float:left;">N/A</div> - </div> <div style="clear:both" class="designatedPrimaryContainer"> <div class="formLabel-labelCell" style="float:left; width: 200px;">Allow this node to operate solo:</div> <div class="designatedPrimary" style="float:left;">N/A</div> @@ -54,16 +50,6 @@ </div> </div> <div style="clear:both"></div> - <br/> - <div style="clear:both" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Environment Configuration'" class="environmentConfigurationPanel"> - <div class="environmentConfiguration"></div> - </div> - <div style="clear:both"></div> - <br/> - <div style="clear:both" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Replicated Environment Configuration'" class="replicatedEnvironmentConfigurationPanel"> - <div class="replicatedEnvironmentConfiguration"></div> - </div> - <div style="clear:both"></div> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Group nodes'" class="membersGridPanel"> <div class="groupMembers"></div> <div class="groupMembersToolbar dijitDialogPaneActionBar"> diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java index 6cc56d0e4d..6f53c1601d 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecoverer.java @@ -242,7 +242,19 @@ public class BrokerStoreUpgraderAndRecoverer addAttributeTransformer("createdBy", copyAttribute()). addAttributeTransformer("storePath", mutateAttributeName("connectionURL")). addAttributeTransformer("connectionURL", mutateAttributeName("connectionUrl")). - addAttributeTransformer("connectionPool", mutateAttributeName("connectionPoolType")). + addAttributeTransformer("connectionPool", new AttributeTransformer() + { + @Override + public MutableEntry transform(MutableEntry entry) + { + Object value = entry.getValue(); + if ("DEFAULT".equals(value)) + { + value = "NONE"; + } + return new MutableEntry("connectionPoolType", value); + } + }). addAttributeTransformer("jdbcBigIntType", addContextVar("qpid.jdbcstore.bigIntType")). addAttributeTransformer("jdbcBytesForBlob", addContextVar("qpid.jdbcstore.useBytesForBlob")). addAttributeTransformer("jdbcBlobType", addContextVar("qpid.jdbcstore.blobType")). diff --git a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java index 7eb5e3b63c..479c117e19 100644 --- a/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java +++ b/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java @@ -63,7 +63,7 @@ public class BrokerStoreUpgraderAndRecovererTest extends QpidTestCase mock(BrokerOptions.class)); } - public void testUpgradeVirtualHostWithJDBCStore() + public void testUpgradeVirtualHostWithJDBCStoreAndBoneCPPool() { Map<String, Object> hostAttributes = new HashMap<>(); hostAttributes.put("name", "test"); @@ -114,6 +114,51 @@ public class BrokerStoreUpgraderAndRecovererTest extends QpidTestCase assertEquals("Unexpected attributes", expectedAttributes, upgradedVirtualHostNodeRecord.getAttributes()); } + public void testUpgradeVirtualHostWithJDBCStoreAndDefaultPool() + { + Map<String, Object> hostAttributes = new HashMap<>(); + hostAttributes.put("name", "test"); + hostAttributes.put("modelVersion", "0.4"); + hostAttributes.put("connectionPool", "DEFAULT"); + hostAttributes.put("connectionURL", "jdbc:derby://localhost:1527/tmp/vh/test;create=true"); + hostAttributes.put("createdBy", "webadmin"); + hostAttributes.put("createdTime", 1401385905260l); + hostAttributes.put("storeType", "jdbc"); + hostAttributes.put("type", "STANDARD"); + hostAttributes.put("jdbcBigIntType", "mybigint"); + hostAttributes.put("jdbcBlobType", "myblob"); + hostAttributes.put("jdbcVarbinaryType", "myvarbinary"); + hostAttributes.put("jdbcBytesForBlob", true); + + + ConfiguredObjectRecord virtualHostRecord = new ConfiguredObjectRecordImpl(UUID.randomUUID(), "VirtualHost", + hostAttributes, Collections.<String,ConfiguredObjectRecord>singletonMap("Broker", _brokerRecord)); + DurableConfigurationStore dcs = new DurableConfigurationStoreStub(_brokerRecord, virtualHostRecord); + + BrokerStoreUpgraderAndRecoverer recoverer = new BrokerStoreUpgraderAndRecoverer(_systemContext); + List<ConfiguredObjectRecord> records = recoverer.upgrade(dcs); + + ConfiguredObjectRecord upgradedVirtualHostNodeRecord = findRecordById(virtualHostRecord.getId(), records); + assertEquals("Unexpected type", "VirtualHostNode", upgradedVirtualHostNodeRecord.getType()); + Map<String,Object> expectedAttributes = new HashMap<>(); + expectedAttributes.put("connectionPoolType", "NONE"); + expectedAttributes.put("connectionUrl", "jdbc:derby://localhost:1527/tmp/vh/test;create=true"); + expectedAttributes.put("createdBy", "webadmin"); + expectedAttributes.put("createdTime", 1401385905260l); + expectedAttributes.put("name", "test"); + expectedAttributes.put("type", "JDBC"); + + final Map<String, Object> context = new HashMap<>(); + context.put("qpid.jdbcstore.bigIntType", "mybigint"); + context.put("qpid.jdbcstore.varBinaryType", "myvarbinary"); + context.put("qpid.jdbcstore.blobType", "myblob"); + context.put("qpid.jdbcstore.useBytesForBlob", true); + + expectedAttributes.put("context", context); + + assertEquals("Unexpected attributes", expectedAttributes, upgradedVirtualHostNodeRecord.getAttributes()); + } + public void testUpgradeVirtualHostWithDerbyStore() { Map<String, Object> hostAttributes = new HashMap<>(); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/derby/add.js b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/add.js index 21d377445d..21d377445d 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/derby/add.js +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/add.js diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/show.js b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/show.js new file mode 100644 index 0000000000..e53ad75fe4 --- /dev/null +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/derby/show.js @@ -0,0 +1,38 @@ +/* + * 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(["qpid/common/util", + "dojo/domReady!"], + function (util) + { + var fields = ["storePath", "storeUnderfullSize", "storeOverfullSize"]; + + function Derby(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhost/sizemonitoring/show.html", fields, this); + } + + Derby.prototype.update = function(data) + { + util.updateUI(data, fields, this); + } + + return Derby; + } +); diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js deleted file mode 100644 index 04016b5fae..0000000000 --- a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhost/store/derby/add.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * 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,34) == "formAddVirtualHost.specific.store.") { - item.destroyRecursive(); - } - }); - - xhr.get({url: "virtualhost/store/derby/add.html", - sync: true, - load: function(data) { - node.innerHTML = data; - parser.parse(node); - - }}); - } - }; - }); diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js index 5272e76e4c..cc84f9edc1 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js @@ -18,34 +18,19 @@ * under the License. * */ -define(["dojo/_base/xhr", - "dojo/_base/lang", - "dojo/_base/connect", - "dojo/parser", - "dojo/string", - "dojox/html/entities", - "dojo/query", - "dojo/json", - "dojo/domReady!"], - function (xhr, lang, connect, parser, json, entities, query, json) +define(["qpid/common/util", "dojo/domReady!"], + function (util) { + var fields = ["storePath"]; + function DerbyNode(data) { - var containerNode = data.containerNode; - this.parent = data.parent; - var that = this; - xhr.get({url: "virtualhostnode/derby/show.html", - sync: true, - load: function(template) { - containerNode.innerHTML = template; - parser.parse(containerNode); - }}); - this.storePath = query(".storePath", containerNode)[0]; + util.buildUI(data.containerNode, data.parent, "virtualhostnode/derby/show.html", fields, this); } DerbyNode.prototype.update=function(data) { - this.storePath.innerHTML = entities.encode(String(data.storePath)); + util.updateUI(data, fields, this); }; return DerbyNode; diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhost/store/derby/add.html b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhost/store/derby/add.html deleted file mode 100644 index ead232d0b1..0000000000 --- a/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhost/store/derby/add.html +++ /dev/null @@ -1,25 +0,0 @@ -<!-- - ~ 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. - --> -<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.store.storePath" - name="storePath" placeholder="/path/to/message/store" /> - </td> - </tr> -</table> diff --git a/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/show.html b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/show.html index 9cf5dadae8..2bdbc761e6 100644 --- a/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/show.html +++ b/qpid/java/broker-plugins/derby-store/src/main/java/resources/virtualhostnode/derby/show.html @@ -16,6 +16,6 @@ --> <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Store Path:</div> - <div class="storePath" style="float:left;"></div> -</div>
\ No newline at end of file + <div class="formLabel-labelCell" style="float:left; width: 200px;">Store Path:</div> + <div class="storePath" style="float:left;"></div> +</div> diff --git a/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/resources/js/qpid/management/store/pool/bonecp/show.js b/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/resources/js/qpid/management/store/pool/bonecp/show.js new file mode 100644 index 0000000000..c0556c28fd --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/resources/js/qpid/management/store/pool/bonecp/show.js @@ -0,0 +1,63 @@ +/* + * + * 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/_base/lang", + "dojo/_base/connect", + "dojo/parser", + "dojo/string", + "dojox/html/entities", + "dojo/query", + "dojo/json", + "dojo/domReady!"], + function (xhr, lang, connect, parser, json, entities, query, json) + { + var fieldNames = ["maxConnectionsPerPartition", "minConnectionsPerPartition", "partitionCount"]; + + function BoneCP(data) + { + var containerNode = data.containerNode; + this.parent = data.parent; + var that = this; + xhr.get({url: "store/pool/bonecp/show.html", + sync: true, + load: function(template) { + containerNode.innerHTML = template; + parser.parse(containerNode); + }}); + for(var i=0; i<fieldNames.length;i++) + { + var fieldName = fieldNames[i]; + this[fieldName]= query("." + fieldName, containerNode)[0]; + } + } + + BoneCP.prototype.update=function(data) + { + for(var i=0; i<fieldNames.length;i++) + { + var fieldName = fieldNames[i]; + var value = data.context["qpid.jdbcstore.bonecp."+fieldName]; + this[fieldName].innerHTML= value?entities.encode(String(value)):""; + } + }; + + return BoneCP; +}); diff --git a/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/resources/store/pool/bonecp/show.html b/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/resources/store/pool/bonecp/show.html new file mode 100644 index 0000000000..8d282b47a0 --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/resources/store/pool/bonecp/show.html @@ -0,0 +1,37 @@ +<!-- + ~ 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. + --> +<div> + <br/> + <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Bone Connection Pool Settings', open: false"> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 200px;">Partition Count:</div> + <div class="partitionCount" style="float:left;"></div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 200px;">Minimum connections per Partition:</div> + <div class="minConnectionsPerPartition" style="float:left;"></div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 200px;">Maximum connections per Partition:</div> + <div class="maxConnectionsPerPartition" style="float:left;"></div> + </div> + <div style="clear:both"></div> + </div> +</div> + diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java index 9e10c54f7e..0a829696f0 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java @@ -30,7 +30,7 @@ import java.util.Set; @PluggableService public class DefaultConnectionProviderFactory implements JDBCConnectionProviderFactory { - public static final String TYPE = "DEFAULT"; + public static final String TYPE = "NONE"; @Override public String getType() diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js new file mode 100644 index 0000000000..39cb2bf507 --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/store/pool/none/show.js @@ -0,0 +1,33 @@ +/* + * + * 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([], + function () + { + function NonePool(data) + { + } + + NonePool.prototype.update=function(data) + { + }; + + return NonePool; +}); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.js new file mode 100644 index 0000000000..5e3a5a087c --- /dev/null +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhost/jdbc/show.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(["qpid/common/util", "dojo/query", "dojo/domReady!"], + function (util, query) + { + var fieldNames = ["connectionUrl", "username", "connectionPoolType"]; + + function JDBC(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhostnode/jdbc/show.html", fieldNames, this); + this.usernameAttributeContainer=query(".usernameAttributeContainer", data.containerNode)[0]; + this.connectionPoolTypeAttributeContainer=query(".connectionPoolTypeAttributeContainer", data.containerNode)[0]; + } + + JDBC.prototype.update = function(data) + { + util.updateUI(data, fieldNames, this); + this.usernameAttributeContainer.style.display = data.username ? "block" : "none"; + if (!this.poolDetails) + { + var that = this; + require(["qpid/management/store/pool/" + data.connectionPoolType.toLowerCase() + "/show"], + function(PoolDetails) + { + that.poolDetails = new PoolDetails({containerNode:that.connectionPoolTypeAttributeContainer, parent: that}); + that.poolDetails.update(data); + } + ); + } + else + { + this.poolDetails.update(data); + } + } + + return JDBC; + } +); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js index eb58b3e7c7..ced243241b 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js @@ -18,46 +18,43 @@ * under the License. * */ -define(["dojo/_base/xhr", - "dojo/_base/lang", - "dojo/_base/connect", - "dojo/parser", - "dojo/string", - "dojox/html/entities", + +define(["qpid/common/util", "dojo/query", - "dojo/json", "dojo/domReady!"], - function (xhr, lang, connect, parser, json, entities, query, json) + function (util, query) { - var fieldNames = ["connectionUrl", "bigIntType", "varBinaryType", "blobType", "bytesForBlob", "connectionPoolType"]; + var fieldNames = ["connectionUrl", "username", "connectionPoolType"]; - function JdbcNode(data) + function Jdbc(data) { - var containerNode = data.containerNode; - this.parent = data.parent; - var that = this; - xhr.get({url: "virtualhostnode/jdbc/show.html", - sync: true, - load: function(template) { - containerNode.innerHTML = template; - parser.parse(containerNode); - }}); - for(var i=0; i<fieldNames.length;i++) - { - var fieldName = fieldNames[i]; - this[fieldName]= query("." + fieldName, containerNode)[0]; - } + util.buildUI(data.containerNode, data.parent, "virtualhostnode/jdbc/show.html", fieldNames, this); + + this.usernameAttributeContainer=query(".usernameAttributeContainer", data.containerNode)[0]; + this.connectionPoolTypeAttributeContainer=query(".connectionPoolTypeAttributeContainer", data.containerNode)[0]; } - JdbcNode.prototype.update=function(data) + Jdbc.prototype.update=function(data) { - for(var i=0; i<fieldNames.length;i++) + util.updateUI(data, fieldNames, this); + + this.usernameAttributeContainer.style.display = data.username ? "block" : "none"; + if (!this.poolDetails) + { + var that = this; + require(["qpid/management/store/pool/" + data.connectionPoolType.toLowerCase() + "/show"], + function(PoolDetails) + { + that.poolDetails = new PoolDetails({containerNode:that.connectionPoolTypeAttributeContainer, parent: that}); + that.poolDetails.update(data); + } + ); + } + else { - var fieldName = fieldNames[i]; - var value = data[fieldName]; - this[fieldName].innerHTML= value?entities.encode(String(value)):""; + this.poolDetails.update(data); } }; - return JdbcNode; + return Jdbc; }); diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html deleted file mode 100644 index 0644887a43..0000000000 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhost/store/jdbc/add.html +++ /dev/null @@ -1,31 +0,0 @@ -<!-- - ~ 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. - --> -<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.store.connectionURL" - name="connectionUrl" placeholder="jdbc:provider:info" /> - </tr> - <tr> - <td class="tableContainer-labelCell" style="width: 300px;"><strong>Connection Pool: </strong></td> - <td class="tableContainer-valueCell" ><div id="addVirtualHost.specific.selectPoolType"></div></td> - </td> - </tr> -</table> -<div id="addVirtualHost.poolSpecificDiv"> -</div> diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html index 63fec28012..7ba60f2f6b 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/show.html @@ -19,26 +19,16 @@ <div class="formLabel-labelCell" style="float:left; width: 200px;">Connection URL:</div> <div class="connectionUrl" style="float:left;"></div> </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Big Integer Type:</div> - <div class="bigIntType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Var Binary Type:</div> - <div class="varBinaryType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Blob Type:</div> - <div class="blobType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Bytes For Blob:</div> - <div class="bytesForBlob" style="float:left;"></div> + <div class="usernameAttributeContainer" style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 200px;">Username:</div> + <div class="username" style="float:left;"></div> </div> <div style="clear:both"> <div class="formLabel-labelCell" style="float:left; width: 200px;">Connection Pool Type:</div> <div class="connectionPoolType" style="float:left;"></div> </div> + <div class="connectionPoolTypeAttributeContainer" style="clear:both"/> + <div style="clear:both"></div> </div> diff --git a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/store/pool/none/add.html index 2666129a1f..2666129a1f 100644 --- a/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/jdbc/none/add.html +++ b/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/virtualhostnode/store/pool/none/add.html diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/show.html index bc302d1e65..aca9f5d309 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/show.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/preferences/filesystempreferences/show.html @@ -18,4 +18,4 @@ <div style="clear:both"> <div class="formLabel-labelCell" style="float:left; width: 100px;">Path:</div> <div class="fileSystemPreferencesProviderPath" style="float:left;"></div> -</div>
\ No newline at end of file +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css b/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css index 8a0ea792f5..8be41ce793 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css @@ -205,4 +205,9 @@ div .messages { font-style: italic; } +.dijitDialogPaneActionBar .editNodeButton +{ + display: none +} + diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html new file mode 100644 index 0000000000..04d6a803a2 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/editVirtualHost.html @@ -0,0 +1,118 @@ +<!-- + ~ 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. + --> +<div class="dijitHidden"> + <div data-dojo-type="dijit/Dialog" data-dojo-props="title:'Edit Virtual Host'" id="editVirtualHostDialog"> + <form id="editVirtualHostForm" method="post" data-dojo-type="dijit/form/Form"> + + <div id="editVirtualHost.typeFields"></div> + + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Dead letter queue enabled:</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input type="checkbox" id="editVirtualHost.queue.deadLetterQueueEnabled" + data-dojo-type="dijit/form/CheckBox" + data-dojo-props="name: 'queue.deadLetterQueueEnabled'"> + </input> + </div> + </div> + + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Store Transaction Idle Timeout Warn:</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/NumberSpinner" + id="editVirtualHost.storeTransactionIdleTimeoutWarn" + name="storeTransactionIdleTimeoutWarn" + smallDelta="1000" + constraints="{min: 0, places: 0, pattern: '#'}" + placeHolder="idle timeout warn time in ms" + missingMessage="An idle timeout warn time in ms must be supplied"/> + </div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Store Transaction Idle Timeout Close:</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/NumberSpinner" + id="editVirtualHost.storeTransactionIdleTimeoutClose" + name="storeTransactionIdleTimeoutClose" + smallDelta="1000" + constraints="{min: 0, places: 0, pattern: '#'}" + placeHolder="idle timeout close time in ms" + missingMessage="An idle timeout close time in ms must be supplied"/> + </div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Store Transaction Open Timeout Warn:</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/NumberSpinner" + id="editVirtualHost.storeTransactionOpenTimeoutWarn" + name="storeTransactionOpenTimeoutWarn" + smallDelta="1000" + constraints="{min: 0, places: 0, pattern: '#'}" + placeHolder="open timeout warn time in ms" + missingMessage="An open timeout warn time in ms must be supplied"/> + </div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">Store Transaction Open Timeout Close:</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/NumberSpinner" + id="editVirtualHost.storeTransactionOpenTimeoutClose" + name="storeTransactionOpenTimeoutClose" + smallDelta="1000" + constraints="{min: 0, places: 0, pattern: '#'}" + placeHolder="open timeout close time in ms" + missingMessage="An open timeout close time in ms must be supplied"/> + </div> + </div> + + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">House keeping check period (ms):</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/NumberSpinner" + id="editVirtualHost.housekeepingCheckPeriod" + name="housekeepingCheckPeriod" + smallDelta="1000" + constraints="{min: 1, places: 0, pattern: '#'}" + placeHolder="house keeping check period in ms" + missingMessage="A house keeping check period must be supplied"/> + </div> + </div> + + <div style="clear:both"> + <div class="formLabel-labelCell tableContainer-labelCell" style="float:left; width: 300px;">House keeping thread count:</div> + <div style="float:left;" class="tableContainer-valueCell formLabel-controlCell"> + <input data-dojo-type="dijit/form/NumberSpinner" + id="editVirtualHost.housekeepingThreadCount" + name="housekeepingThreadCount" + smallDelta="1" + constraints="{min: 1, places: 0, pattern: '#'}" + placeHolder="house keeping thread count" + missingMessage="A house keeping thread count must be supplied"/> + </div> + </div> + + <div style="clear:both"></div> + + <div class="dijitDialogPaneActionBar"> + <button data-dojo-type="dijit/form/Button" id="editVirtualHost.saveButton" data-dojo-props="label: 'Save'">Save</button> + <button data-dojo-type="dijit/form/Button" id="editVirtualHost.cancelButton" data-dojo-props="label: 'Cancel'" ></button> + </div> + </form> + </div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js index 1391d7d5ff..60c05a5df6 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js @@ -26,6 +26,9 @@ define(["dojo/_base/xhr", "dojo/dom-construct", "dojo/dom-geometry", "dojo/window", + "dojo/query", + "dojo/parser", + "dojox/html/entities", "dijit/TitlePane", "dijit/Dialog", "dijit/form/Form", @@ -38,7 +41,7 @@ define(["dojo/_base/xhr", "dojox/validate/web", "dojo/domReady!" ], - function (xhr, event, json, lang, dom, geometry, win) { + function (xhr, event, json, lang, dom, geometry, win, query, parser, entities) { var util = {}; if (Array.isArray) { util.isArray = function (object) { @@ -491,5 +494,73 @@ define(["dojo/_base/xhr", return object1 === object2; } + util.buildUI = function(containerNode, parent, htmlTemplateLocation, fieldNames, obj) + { + xhr.get({url: htmlTemplateLocation, + sync: true, + load: function(template) { + containerNode.innerHTML = template; + parser.parse(containerNode); + }}); + for(var i=0; i<fieldNames.length;i++) + { + var fieldName = fieldNames[i]; + obj[fieldName]= query("." + fieldName, containerNode)[0]; + } + } + + util.updateUI = function(data, fieldNames, obj) + { + for(var i=0; i<fieldNames.length;i++) + { + var fieldName = fieldNames[i]; + var value = data[fieldName]; + obj[fieldName].innerHTML= (value == undefined || value == null) ? "" : entities.encode(String(value)); + } + } + + util.getFormWidgetValues = function (form) + { + var values = {}; + var formWidgets = form.getChildren(); + for(var i in formWidgets) + { + var widget = formWidgets[i]; + var value = widget.value; + var propName = widget.name; + if (propName && (widget.required || value )) + { + if (widget instanceof dijit.form.CheckBox) + { + values[ propName ] = widget.checked; + } + else if (widget instanceof dijit.form.RadioButton && value) + { + var currentValue = values[propName]; + if (currentValue) + { + if (lang.isArray(currentValue)) + { + currentValue.push(value) + } + else + { + values[ propName ] = [currentValue, value]; + } + } + else + { + values[ propName ] = value; + } + } + else + { + values[ propName ] = value ? value: null; + } + } + } + return values; + } + return util; }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js index 999638d0c7..d0ffb49c2e 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js @@ -32,8 +32,9 @@ define(["dojo/_base/xhr", "qpid/management/addQueue", "qpid/management/addExchange", "dojox/grid/EnhancedGrid", + "qpid/management/editVirtualHost", "dojo/domReady!"], - function (xhr, parser, query, connect, registry, entities, properties, updater, util, formatter, UpdatableStore, addQueue, addExchange, EnhancedGrid) { + function (xhr, parser, query, connect, registry, entities, properties, updater, util, formatter, UpdatableStore, addQueue, addExchange, EnhancedGrid, editVirtualHost) { function VirtualHost(name, parent, controller) { this.name = name; @@ -52,21 +53,18 @@ define(["dojo/_base/xhr", xhr.get({url: "showVirtualHost.html", sync: true, load: function(data) { - contentPane.containerNode.innerHTML = data; - parser.parse(contentPane.containerNode); + var containerNode = contentPane.containerNode; + containerNode.innerHTML = data; + parser.parse(containerNode); - that.vhostUpdater = new Updater(contentPane.containerNode, that.modelObj, that.controller); + that.vhostUpdater = new Updater(containerNode, that.modelObj, that.controller, that); - updater.add( that.vhostUpdater ); - - that.vhostUpdater.update(); - - var addQueueButton = query(".addQueueButton", contentPane.containerNode)[0]; + var addQueueButton = query(".addQueueButton", containerNode)[0]; connect.connect(registry.byNode(addQueueButton), "onClick", function(evt){ addQueue.show({virtualhost:that.name,virtualhostnode:that.modelObj.parent.name}) }); - var deleteQueueButton = query(".deleteQueueButton", contentPane.containerNode)[0]; + var deleteQueueButton = query(".deleteQueueButton", containerNode)[0]; connect.connect(registry.byNode(deleteQueueButton), "onClick", function(evt){ util.deleteGridSelections( @@ -77,10 +75,10 @@ define(["dojo/_base/xhr", } ); - var addExchangeButton = query(".addExchangeButton", contentPane.containerNode)[0]; + var addExchangeButton = query(".addExchangeButton", containerNode)[0]; connect.connect(registry.byNode(addExchangeButton), "onClick", function(evt){ addExchange.show({virtualhost:that.name,virtualhostnode:that.modelObj.parent.name}) }); - var deleteExchangeButton = query(".deleteExchangeButton", contentPane.containerNode)[0]; + var deleteExchangeButton = query(".deleteExchangeButton", containerNode)[0]; connect.connect(registry.byNode(deleteExchangeButton), "onClick", function(evt) { @@ -91,6 +89,54 @@ define(["dojo/_base/xhr", "Are you sure you want to delete exchange"); } ); + + that.stopButton = registry.byNode(query(".stopButton", containerNode)[0]); + that.startButton = registry.byNode(query(".startButton", containerNode)[0]); + that.editButton = registry.byNode(query(".editButton", containerNode)[0]); + that.deleteButton = registry.byNode(query(".deleteButton", containerNode)[0]); + that.deleteButton.on("click", + function(e) + { + if (confirm("Deletion of virtual host will delete message data.\n\n" + + "Are you sure you want to delete virtual host '" + entities.encode(String(that.name)) + "'?")) + { + if (util.sendRequest("api/latest/virtualhost/" + encodeURIComponent(that.modelObj.parent.name) + "/" + encodeURIComponent( that.name) , "DELETE")) + { + that.destroy(); + } + } + } + ); + that.startButton.on("click", + function(event) + { + that.startButton.set("disabled", true); + util.sendRequest("api/latest/virtualhost/" + encodeURIComponent(that.modelObj.parent.name) + "/" + encodeURIComponent( that.name), + "PUT", {desiredState: "ACTIVE"}); + }); + + that.stopButton.on("click", + function(event) + { + if (confirm("Stopping the virtual host will also stop its children. " + + "Are you sure you want to stop virtual host '" + + entities.encode(String(that.name)) +"'?")) + { + that.stopButton.set("disabled", true); + util.sendRequest("api/latest/virtualhost/" + encodeURIComponent(that.modelObj.parent.name) + "/" + encodeURIComponent( that.name), + "PUT", {desiredState: "STOPPED"}); + } + }); + + that.editButton.on("click", + function(event) + { + editVirtualHost.show({nodeName:that.modelObj.parent.name,hostName:that.name}); + }); + + that.vhostUpdater.update(); + updater.add( that.vhostUpdater ); + }}); }; @@ -99,9 +145,17 @@ define(["dojo/_base/xhr", updater.remove( this.vhostUpdater ); }; - function Updater(node, vhost, controller) + VirtualHost.prototype.destroy = function() { + this.close(); + this.contentPane.onClose() + this.controller.tabContainer.removeChild(this.contentPane); + this.contentPane.destroyRecursive(); + } + function Updater(node, vhost, controller, virtualHost) + { + this.virtualHost = virtualHost; var that = this; function findNode(name) { @@ -116,6 +170,7 @@ define(["dojo/_base/xhr", } storeNodes(["name", + "type", "state", "durable", "lifetimePolicy", @@ -125,9 +180,15 @@ define(["dojo/_base/xhr", "msgOutRate", "bytesOutRate", "bytesOutRateUnits", - "storeType", - "storePath", - "configPath"]); + "virtualHostDetailsContainer", + "deadLetterQueueEnabled", + "housekeepingCheckPeriod", + "housekeepingThreadCount", + "storeTransactionIdleTimeoutClose", + "storeTransactionIdleTimeoutWarn", + "storeTransactionOpenTimeoutClose", + "storeTransactionOpenTimeoutWarn" + ]); this.query = "api/latest/virtualhost/"+ encodeURIComponent(vhost.parent.name) + "/" + encodeURIComponent(vhost.name); @@ -136,11 +197,6 @@ define(["dojo/_base/xhr", xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}).then(function(data) { that.vhostData = data[0]; - if (!that.vhostData.hasOwnProperty("configPath")) - { - var node = findNode("configPathDiv"); - node.style.display = "none"; - } // flatten statistics into attributes util.flattenStatistics( that.vhostData ); @@ -231,24 +287,33 @@ define(["dojo/_base/xhr", Updater.prototype.updateHeader = function() { this.name.innerHTML = entities.encode(String(this.vhostData[ "name" ])); + this.type.innerHTML = entities.encode(String(this.vhostData[ "type" ])); this.state.innerHTML = entities.encode(String(this.vhostData[ "state" ])); this.durable.innerHTML = entities.encode(String(this.vhostData[ "durable" ])); this.lifetimePolicy.innerHTML = entities.encode(String(this.vhostData[ "lifetimePolicy" ])); - if (this.vhostData.messageStoreSettings) - { - this.storeType.innerHTML = entities.encode(String(this.vhostData[ "messageStoreSettings" ].storeType)); - this.storePath.innerHTML = entities.encode(String(this.vhostData[ "messageStoreSettings" ].storePath)); - } + this.deadLetterQueueEnabled.innerHTML = entities.encode(String(this.vhostData[ "queue.deadLetterQueueEnabled" ])); + util.updateUI(this.vhostData, + ["housekeepingCheckPeriod", + "housekeepingThreadCount", + "storeTransactionIdleTimeoutClose", + "storeTransactionIdleTimeoutWarn", + "storeTransactionOpenTimeoutClose", + "storeTransactionOpenTimeoutWarn"], + this) }; Updater.prototype.update = function() { - var thisObj = this; xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}) .then(function(data) { thisObj.vhostData = data[0]; + + thisObj.virtualHost.startButton.set("disabled", thisObj.vhostData.state != "STOPPED"); + thisObj.virtualHost.stopButton.set("disabled", thisObj.vhostData.state != "ACTIVE"); + thisObj.virtualHost.editButton.set("disabled", false); + util.flattenStatistics( thisObj.vhostData ); var connections = thisObj.vhostData[ "connections" ]; var queues = thisObj.vhostData[ "queues" ]; @@ -348,7 +413,20 @@ define(["dojo/_base/xhr", // update connections thisObj.connectionsGrid.update(thisObj.vhostData.connections) - + if (thisObj.details) + { + thisObj.details.update(thisObj.vhostData); + } + else + { + require(["qpid/management/virtualhost/" + thisObj.vhostData.type.toLowerCase() + "/show"], + function(VirtualHostDetails) + { + thisObj.details = new VirtualHostDetails({containerNode:thisObj.virtualHostDetailsContainer, parent: thisObj}); + thisObj.details.update(thisObj.vhostData); + } + ); + } }); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js index f34b2df8a8..78ef2e89df 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js @@ -138,7 +138,7 @@ define(["dojo/_base/xhr", } } - storeNodes(["name", "state", "type", "messageStoreProviderYes","messageStoreProviderNo"]); + storeNodes(["name", "state", "type"]); this.detailsDiv = findNode("virtualhostnodedetails"); this.query = "api/latest/virtualhostnode/" + encodeURIComponent(nodeObject.name); @@ -163,8 +163,6 @@ define(["dojo/_base/xhr", this.name.innerHTML = entities.encode(String(data[ "name" ])); this.state.innerHTML = entities.encode(String(data[ "state" ])); this.type.innerHTML = entities.encode(String(data[ "type" ])); - this.messageStoreProviderYes.style.display = data.messageStoreProvider? "block" : "none"; - this.messageStoreProviderNo.style.display = data.messageStoreProvider? "none" : "block"; if (!this.details) { var that = this; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js new file mode 100644 index 0000000000..abc127caf5 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js @@ -0,0 +1,161 @@ +/* + * + * 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", + "dojox/html/entities", + "dojo/_base/array", + "dojo/_base/event", + "dojo/_base/lang", + "dojo/_base/window", + "dojo/dom", + "dojo/dom-construct", + "dijit/registry", + "dojo/parser", + 'dojo/json', + "dojo/query", + "dojo/store/Memory", + "dojo/data/ObjectStore", + "qpid/common/util", + "dojo/text!editVirtualHost.html", + "dijit/Dialog", + "dijit/form/CheckBox", + "dijit/form/FilteringSelect", + "dijit/form/ValidationTextBox", + "dijit/form/Button", + "dijit/form/Form", + "dijit/form/NumberSpinner", + "dojox/validate/us", + "dojox/validate/web", + "dojo/domReady!"], + function (xhr, entities, array, event, lang, win, dom, domConstruct, registry, parser, json, query, Memory, ObjectStore, util, template) + { + var fields = [ "queue.deadLetterQueueEnabled", "storeTransactionIdleTimeoutWarn", "storeTransactionIdleTimeoutClose", "storeTransactionOpenTimeoutWarn", "storeTransactionOpenTimeoutClose", "housekeepingCheckPeriod", "housekeepingThreadCount"]; + + var virtualHostEditor = + { + init: function() + { + var that=this; + this.containerNode = domConstruct.create("div", {innerHTML: template}); + parser.parse(this.containerNode); + this.dialog = registry.byId("editVirtualHostDialog") + this.saveButton = registry.byId("editVirtualHost.saveButton"); + this.cancelButton = registry.byId("editVirtualHost.cancelButton"); + this.cancelButton.on("click", function(e){that._cancel(e);}); + this.saveButton.on("click", function(e){that._save(e);}); + for(var i = 0; i < fields.length; i++) + { + var fieldName = fields[i]; + this[fieldName] = registry.byId("editVirtualHost." + fieldName); + } + this.form = registry.byId("editVirtualHostForm"); + }, + show: function(hostData) + { + var that=this; + this.hostName = hostData.hostName; + this.query = "api/latest/virtualhost/" + encodeURIComponent(hostData.nodeName) + "/" + encodeURIComponent(hostData.hostName); + this.dialog.set("title", "Edit Virtual Host - " + entities.encode(String(hostData.hostName))); + xhr.get( + { + url: this.query, + sync: true, + handleAs: "json", + load: function(data) + { + that._show(data[0]); + } + } + ); + }, + destroy: function() + { + if (this.dialog) + { + this.dialog.destroyRecursive(); + this.dialog = null; + } + + if (this.containerNode) + { + domConstruct.destroy(this.containerNode); + this.containerNode = null; + } + }, + _cancel: function(e) + { + this.dialog.hide(); + }, + _save: function(e) + { + event.stop(e); + if(this.form.validate()) + { + var data = util.getFormWidgetValues(this.form); + + var success = false,failureReason=null; + xhr.put({ + url: this.query, + sync: true, + handleAs: "json", + headers: { "Content-Type": "application/json"}, + putData: json.stringify(data), + load: function(x) {success = true; }, + error: function(error) {success = false; failureReason = error;} + }); + + if(success === true) + { + this.dialog.hide(); + } + else + { + alert("Error:" + failureReason); + } + } + else + { + alert('Form contains invalid data. Please correct first'); + } + }, + _show:function(node) + { + for(var i = 0; i < fields.length; i++) + { + var fieldName = fields[i]; + if (this[fieldName] instanceof dijit.form.CheckBox) + { + this[fieldName].set("checked", node[fieldName]); + } + else + { + this[fieldName].set("value", node[fieldName]); + } + + } + this.dialog.show(); + } + }; + + virtualHostEditor.init(); + + return virtualHostEditor; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/show.js new file mode 100644 index 0000000000..8416211c62 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/show.js @@ -0,0 +1,37 @@ +/* + * 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(["qpid/common/util", "dojo/domReady!"], + function (util) + { + var fields = ["storeUnderfullSize", "storeOverfullSize"]; + + function ProvidedStore(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhost/providedstore/show.html", fields, this); + } + + ProvidedStore.prototype.update = function(data) + { + util.updateUI(data, fields, this); + } + + return ProvidedStore; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js index bbff43c706..80e3ce26f1 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js @@ -18,35 +18,22 @@ * under the License. * */ -define(["dojo/_base/xhr", - "dojo/_base/lang", - "dojo/_base/connect", - "dojo/parser", - "dojo/string", - "dojox/html/entities", - "dojo/query", - "dojo/json", - "dojo/domReady!"], - function (xhr, lang, connect, parser, json, entities, query, json) - { - function JsonNode(data) - { - var containerNode = data.containerNode; - this.parent = data.parent; - var that = this; - xhr.get({url: "virtualhostnode/json/show.html", - sync: true, - load: function(template) { - containerNode.innerHTML = template; - parser.parse(containerNode); - }}); - this.storePath = query(".storePath", containerNode)[0]; - } + define(["qpid/common/util", + "dojo/domReady!"], + function (util) + { + var fields = ["storePath"]; - JsonNode.prototype.update=function(data) - { - this.storePath.innerHTML = entities.encode(String(data.storePath)); - }; + function JSON(data) + { + util.buildUI(data.containerNode, data.parent, "virtualhostnode/json/show.html", fields, this); + } - return JsonNode; -}); + JSON.prototype.update = function(data) + { + util.updateUI(data, fields, this); + } + + return JSON; + } + ); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html index 93a802c37e..8957639dae 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHost.html @@ -27,6 +27,10 @@ <div class="name" style="float:left;"></div> </div> <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Type:</div> + <div class="type" style="float:left;"></div> + </div> + <div style="clear:both"> <div class="formLabel-labelCell" style="float:left; width: 100px;">State:</div> <div class="state" style="float:left;"></div> </div> @@ -39,6 +43,65 @@ <div class="lifetimePolicy" style="float:left;"></div> </div> <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;">Dead letter queue enabled:</div> + <div class="deadLetterQueueEnabled" style="float:left;"></div> + </div> + <div style="clear:both" class="virtualHostDetailsContainer"></div> + <div style="clear:both"></div> + + <br/> + + <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Store Transaction Settings', open: false"> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;">Idle timeout before a warning (ms) :</div> + <div class="storeTransactionIdleTimeoutWarn" style="float:left;"></div> + <div class="formLabel-description">The time a transaction can be idle for after which a warning alert will be issued</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;">Idle timeout before closing (ms) :</div> + <div class="storeTransactionIdleTimeoutClose" style="float:left;"></div> + <div class="formLabel-description">The time a transaction can be idle for before the connection it is on is closed</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;" >Open timeout before warning (ms) :</div> + <div class="storeTransactionOpenTimeoutWarn" style="float:left;"></div> + <div class="formLabel-description">The time a transaction can be open for after which a warning alert will be issued</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;">Open timeout before closing (ms) :</div> + <div class="storeTransactionOpenTimeoutClose" style="float:left;"></div> + <div class="formLabel-description">The time a transaction can be open for before the connection it is on is closed</div> + </div> + <div style="clear:both"></div> + </div> + + <br/> + + <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'House Keeping Settings', open: false"> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;">House keeping check period (ms):</div> + <div class="housekeepingCheckPeriod" style="float:left;"></div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 300px;">House keeping thread count:</div> + <div class="housekeepingThreadCount" style="float:left;"></div> + </div> + <div style="clear:both"></div> + </div> + + </div> + + <div class="dijitDialogPaneActionBar"> + <button data-dojo-type="dijit.form.Button" class="startButton" type="button" data-dojo-props="disabled: true">Start</button> + <button data-dojo-type="dijit.form.Button" class="stopButton" type="button" data-dojo-props="disabled: true">Stop</button> + <button data-dojo-type="dijit.form.Button" class="editButton" type="button" data-dojo-props="disabled: true">Edit</button> + <button data-dojo-type="dijit.form.Button" class="deleteButton" data-dojo-props="iconClass: 'dijitIconDelete'">Delete</button> + </div> + + <br/> + + <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Statistics', open: true"> + <div style="clear:both"> <div class="formLabel-labelCell" style="float:left; width: 100px;">Inbound:</div> <div style="float:left;"> <span class="msgInRate"></span> @@ -56,20 +119,9 @@ <span class="bytesOutRateUnits"></span> </div> </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Type:</div> - <div class="storeType" style="float:left;"></div> - </div> - <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Path:</div> - <div class="storePath" style="float:left;"></div> - </div> - <div class="configPathDiv" style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 100px;">Config Path:</div> - <div class="configPath" style="float:left;"></div> - </div> <div style="clear:both"></div> - </div> + </div> + <br/> <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Exchanges'"> <div class="exchanges"></div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html index f5643eebfd..d6c0bcb549 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html @@ -27,17 +27,12 @@ <div class="name" style="float:left;"></div> </div> <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">State:</div> - <div class="state" style="float:left;"></div> - </div> - <div style="clear:both"> <div class="formLabel-labelCell" style="float:left; width: 200px;">Type:</div> <div class="type" style="float:left;"></div> </div> <div style="clear:both"> - <div class="formLabel-labelCell" style="float:left; width: 200px;">Message Store Provider:</div> - <div class="messageStoreProviderYes" style="float:left;display:none">Yes</div> - <div class="messageStoreProviderNo" style="float:left;display:none">No</div> + <div class="formLabel-labelCell" style="float:left; width: 200px;">State:</div> + <div class="state" style="float:left;"></div> </div> <div class="virtualhostnodedetails" style="clear:both"> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/show.html new file mode 100644 index 0000000000..a81511495b --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/show.html @@ -0,0 +1,30 @@ +<!-- + ~ 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. + --> + +<div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Overfull Limit:</div> + <div style="float:left;"><span class="storeOverfullSize" ></span> bytes</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Underfull Limit:</div> + <div style="float:left;"><span class="storeUnderfullSize"></span> bytes</div> + </div> + <div style="clear:both"></div> +</div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/show.html new file mode 100644 index 0000000000..23f9069ce2 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/show.html @@ -0,0 +1,34 @@ +<!-- + ~ 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. + --> + +<div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Path:</div> + <div class="storePath" style="float:left;"></div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Overfull Limit:</div> + <div style="float:left;"><span class="storeOverfullSize" ></span> bytes</div> + </div> + <div style="clear:both"> + <div class="formLabel-labelCell" style="float:left; width: 100px;">Store Underfull Limit:</div> + <div style="float:left;"><span class="storeUnderfullSize"></span> bytes</div> + </div> + <div style="clear:both"></div> +</div> diff --git a/qpid/java/broker-plugins/memory-store/src/main/java/resources/js/qpid/management/virtualhost/memory/show.js b/qpid/java/broker-plugins/memory-store/src/main/java/resources/js/qpid/management/virtualhost/memory/show.js new file mode 100644 index 0000000000..a431b63b86 --- /dev/null +++ b/qpid/java/broker-plugins/memory-store/src/main/java/resources/js/qpid/management/virtualhost/memory/show.js @@ -0,0 +1,33 @@ +/* + * 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([], + function () + { + function Memory(data) + { + } + + Memory.prototype.update = function(data) + { + } + + return Memory; + } +); diff --git a/qpid/java/broker-plugins/memory-store/src/main/java/resources/js/qpid/management/virtualhostnode/memory/show.js b/qpid/java/broker-plugins/memory-store/src/main/java/resources/js/qpid/management/virtualhostnode/memory/show.js new file mode 100644 index 0000000000..a431b63b86 --- /dev/null +++ b/qpid/java/broker-plugins/memory-store/src/main/java/resources/js/qpid/management/virtualhostnode/memory/show.js @@ -0,0 +1,33 @@ +/* + * 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([], + function () + { + function Memory(data) + { + } + + Memory.prototype.update = function(data) + { + } + + return Memory; + } +); |
