summaryrefslogtreecommitdiff
path: root/qpid/java/bdbstore/src/main
diff options
context:
space:
mode:
authorAndrew MacBean <macbean@apache.org>2014-07-25 16:16:12 +0000
committerAndrew MacBean <macbean@apache.org>2014-07-25 16:16:12 +0000
commit151622bd91d7eb031498ff598a31a295af27799b (patch)
tree37c36b0b878866689603d6c85da3a217d6125d2d /qpid/java/bdbstore/src/main
parent6b02c4c08fdc26de6e048357111d9e0b85ab4927 (diff)
downloadqpid-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/bdbstore/src/main')
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb/show.js38
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhost/bdb_ha/show.js69
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js58
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js54
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/virtualhost/bdb_ha/show.html75
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb/show.html5
-rw-r--r--qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html14
7 files changed, 194 insertions, 119 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">