summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2013-04-22 10:25:47 +0000
committerRobert Godfrey <rgodfrey@apache.org>2013-04-22 10:25:47 +0000
commitba219af8c78c7f6c23590a7b9f3cbc73dd6fd0e0 (patch)
tree3c8da5dfb56da150c451747275dbd8e2c1aab697
parentc57f2674650fa6ada8bf7324493e550ecf00b0e1 (diff)
downloadqpid-python-ba219af8c78c7f6c23590a7b9f3cbc73dd6fd0e0.tar.gz
QPID-4677 : merged to QPID-4659 branch
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-4659@1470433 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js147
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js10
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html74
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java16
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java38
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java18
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java32
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java48
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java4
-rw-r--r--qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java8
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java39
11 files changed, 324 insertions, 110 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
index 6c2065fe9d..f5e40025c2 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
@@ -183,141 +183,154 @@ define(["dojo/_base/xhr",
name: "peerStorePassword"});
}
}, {
- name: "alertThresholdQueueDepth",
+ name: "queue.alertThresholdQueueDepthMessages",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.alertThresholdQueueDepth,
+ value: brokerData["queue.alertThresholdQueueDepthMessages"],
placeholder: "Count of messages",
- label: "Queue depth alert threshold:",
- name: "alertThresholdQueueDepth"
+ label: "Queue depth messages alert threshold:",
+ name: "queue.alertThresholdQueueDepthMessages"
});
}
}, {
- name: "alertThresholdMessageAge",
+ name: "queue.alertThresholdQueueDepthBytes",
+ createWidget: function(brokerData) {
+ return new dijit.form.ValidationTextBox({
+ trim: "true",
+ regexp: "[0-9]+",
+ invalidMessage: "Invalid value",
+ required: false,
+ value: brokerData["queue.alertThresholdQueueDepthBytes"],
+ placeholder: "Number of bytes",
+ label: "Queue depth bytes alert threshold:",
+ name: "queue.alertThresholdQueueDepthBytes"
+ });
+ }
+ }, {
+ name: "queue.alertThresholdMessageAge",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.alertThresholdMessageAge,
+ value: brokerData["queue.alertThresholdMessageAge"],
placeholder: "Time in ms",
label: "Queue message age alert threshold:",
- name: "alertThresholdMessageAge"
+ name: "queue.alertThresholdMessageAge"
});
}
}, {
- name: "alertThresholdMessageSize",
+ name: "queue.alertThresholdMessageSize",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.alertThresholdMessageSize,
+ value: brokerData["queue.alertThresholdMessageSize"],
placeholder: "Size in bytes",
label: "Queue message size alert threshold:",
- name: "alertThresholdMessageSize"
+ name: "queue.alertThresholdMessageSize"
});
}
}, {
- name: "alertRepeatGap",
+ name: "queue.alertRepeatGap",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.alertThresholdMessageSize,
- value: brokerData.alertRepeatGap,
+ value: brokerData["queue.alertRepeatGap"],
placeholder: "Time in ms",
label: "Queue alert repeat gap:",
- name: "alertRepeatGap"
+ name: "queue.alertRepeatGap"
});
}
}, {
- name: "maximumDeliveryAttempts",
+ name: "queue.maximumDeliveryAttempts",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.maximumDeliveryAttempts,
+ value: brokerData["queue.maximumDeliveryAttempts"],
placeholder: "Count of messages",
label: "Queue maximum delivery retries:",
- name: "maximumDeliveryAttempts"
+ name: "queue.maximumDeliveryAttempts"
});
}
}, {
- name: "deadLetterQueueEnabled",
+ name: "queue.deadLetterQueueEnabled",
createWidget: function(brokerData) {
return new dijit.form.CheckBox({
required: false,
- checked: brokerData.deadLetterQueueEnabled,
+ checked: brokerData["queue.deadLetterQueueEnabled"],
value: "true",
label: "Dead letter queue enabled:",
- name: "deadLetterQueueEnabled",
+ name: "queue.deadLetterQueueEnabled",
});
}
}, {
- name: "queueFlowControlSizeBytes",
+ name: "queue.flowControlSizeBytes",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.queueFlowControlSizeBytes,
+ value: brokerData["queue.flowControlSizeBytes"],
placeholder: "Size in bytes",
label: "Queue flow capacity:",
- name: "queueFlowControlSizeBytes",
+ name: "queue.flowControlSizeBytes",
});
}
}, {
- name: "queueFlowResumeSizeBytes",
+ name: "queue.flowResumeSizeBytes",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.queueFlowResumeSizeBytes,
+ value: brokerData["queue.flowResumeSizeBytes"],
placeholder: "Size in bytes",
label: "Queue flow resume capacity:",
- name: "queueFlowResumeSizeBytes",
+ name: "queue.flowResumeSizeBytes",
});
}
}, {
- name: "sessionCountLimit",
+ name: "connection.sessionCountLimit",
createWidget: function(brokerData)
{
return new dijit.form.NumberSpinner({
invalidMessage: "Invalid value",
required: false,
- value: brokerData.sessionCountLimit,
+ value: brokerData["connection.sessionCountLimit"],
smallDelta: 1,
constraints: {min:1,max:65535,places:0, pattern: "#####"},
label: "Connection session limit:",
- name: "sessionCountLimit"
+ name: "connection.sessionCountLimit"
});
}
}, {
- name: "heartBeatDelay",
+ name: "connection.heartBeatDelay",
createWidget: function(brokerData) {
return new dijit.form.ValidationTextBox({
trim: "true",
regexp: "[0-9]+",
invalidMessage: "Invalid value",
required: false,
- value: brokerData.heartBeatDelay,
+ value: brokerData["connection.heartBeatDelay"],
placeholder: "Time in ms",
label: "Heart beat delay:",
- name: "heartBeatDelay"
+ name: "connection.heartBeatDelay"
});
}
}, {
@@ -344,6 +357,76 @@ define(["dojo/_base/xhr",
name: "statisticsReportingResetEnabled"
});
}
+ }, {
+ name: "virtualhost.housekeepingCheckPeriod",
+ createWidget: function(brokerData) {
+ return new dijit.form.ValidationTextBox({
+ trim: "true",
+ regexp: "[0-9]+",
+ invalidMessage: "Invalid value",
+ required: false,
+ value: brokerData["virtualhost.housekeepingCheckPeriod"],
+ placeholder: "Time in ms",
+ label: "House keeping check period:",
+ name: "virtualhost.housekeepingCheckPeriod"
+ });
+ }
+ }, {
+ name: "virtualhost.storeTransactionIdleTimeoutClose",
+ createWidget: function(brokerData) {
+ return new dijit.form.ValidationTextBox({
+ trim: "true",
+ regexp: "[0-9]+",
+ invalidMessage: "Invalid value",
+ required: false,
+ value: brokerData["virtualhost.storeTransactionIdleTimeoutClose"],
+ placeholder: "Time in ms",
+ label: "Idle store transaction close timeout:",
+ name: "virtualhost.storeTransactionIdleTimeoutClose"
+ });
+ }
+ }, {
+ name: "virtualhost.storeTransactionIdleTimeoutWarn",
+ createWidget: function(brokerData) {
+ return new dijit.form.ValidationTextBox({
+ trim: "true",
+ regexp: "[0-9]+",
+ invalidMessage: "Invalid value",
+ required: false,
+ value: brokerData["virtualhost.storeTransactionIdleTimeoutWarn"],
+ placeholder: "Time in ms",
+ label: "Idle store transaction warn timeout:",
+ name: "virtualhost.storeTransactionIdleTimeoutWarn"
+ });
+ }
+ }, {
+ name: "virtualhost.storeTransactionOpenTimeoutClose",
+ createWidget: function(brokerData) {
+ return new dijit.form.ValidationTextBox({
+ trim: "true",
+ regexp: "[0-9]+",
+ invalidMessage: "Invalid value",
+ required: false,
+ value: brokerData["virtualhost.storeTransactionOpenTimeoutClose"],
+ placeholder: "Time in ms",
+ label: "Open store transaction close timeout:",
+ name: "virtualhost.storeTransactionOpenTimeoutClose"
+ });
+ }
+ }, {
+ name: "virtualhost.storeTransactionOpenTimeoutWarn",
+ createWidget: function(brokerData) {
+ return new dijit.form.ValidationTextBox({
+ trim: "true",
+ regexp: "[0-9]+",
+ invalidMessage: "Invalid value",
+ required: false,
+ value: brokerData["virtualhost.storeTransactionOpenTimeoutWarn"],
+ placeholder: "Time in ms",
+ label: "Open store transaction warn timeout:",
+ name: "virtualhost.storeTransactionOpenTimeoutWarn"
+ });
+ }
} ];
}
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 ceab5640d3..db24951921 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
@@ -263,28 +263,28 @@ define(["dojo/_base/xhr",
// update alerting info
- var alertRepeatGap = formatter.formatTime( thisObj.vhostData["alertRepeatGap"] );
+ var alertRepeatGap = formatter.formatTime( thisObj.vhostData["queue.alertRepeatGap"] );
thisObj.alertRepeatGap.innerHTML = alertRepeatGap.value;
thisObj.alertRepeatGapUnits.innerHTML = alertRepeatGap.units;
- var alertMsgAge = formatter.formatTime( thisObj.vhostData["alertThresholdMessageAge"] );
+ var alertMsgAge = formatter.formatTime( thisObj.vhostData["queue.alertThresholdMessageAge"] );
thisObj.alertThresholdMessageAge.innerHTML = alertMsgAge.value;
thisObj.alertThresholdMessageAgeUnits.innerHTML = alertMsgAge.units;
- var alertMsgSize = formatter.formatBytes( thisObj.vhostData["alertThresholdMessageSize"] );
+ var alertMsgSize = formatter.formatBytes( thisObj.vhostData["queue.alertThresholdMessageSize"] );
thisObj.alertThresholdMessageSize.innerHTML = alertMsgSize.value;
thisObj.alertThresholdMessageSizeUnits.innerHTML = alertMsgSize.units;
- var alertQueueDepth = formatter.formatBytes( thisObj.vhostData["alertThresholdQueueDepthBytes"] );
+ var alertQueueDepth = formatter.formatBytes( thisObj.vhostData["queue.alertThresholdQueueDepthBytes"] );
thisObj.alertThresholdQueueDepthBytes.innerHTML = alertQueueDepth.value;
thisObj.alertThresholdQueueDepthBytesUnits.innerHTML = alertQueueDepth.units;
- thisObj.alertThresholdQueueDepthMessages.innerHTML = thisObj.vhostData["alertThresholdQueueDepthMessages"];
+ thisObj.alertThresholdQueueDepthMessages.innerHTML = thisObj.vhostData["queue.alertThresholdQueueDepthMessages"];
var stats = thisObj.vhostData[ "statistics" ];
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
index bdcff2b7e9..0cac138cb1 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
@@ -93,50 +93,78 @@
</div>
<div style="clear:both"></div>
<br/>
- <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Queue Attributes', open: true">
- <div id="brokerAttribute.alertThresholdQueueDepth.container" style="clear:both">
- <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue depth alert threshold:</div>
- <div id="brokerAttribute.alertThresholdQueueDepth" style="float:left;"></div>
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Global Queue Defaults', open: true">
+ <div id="brokerAttribute.queue.alertThresholdQueueDepthMessages.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue depth messages alert threshold:</div>
+ <div id="brokerAttribute.queue.alertThresholdQueueDepthMessages" style="float:left;"></div>
</div>
- <div id="brokerAttribute.alertThresholdMessageAge.container" style="clear:both">
+ <div id="brokerAttribute.queue.alertThresholdQueueDepthBytes.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue depth bytes alert threshold:</div>
+ <div id="brokerAttribute.queue.alertThresholdQueueDepthBytes" style="float:left;"></div> bytes
+ </div>
+ <div id="brokerAttribute.queue.alertThresholdMessageAge.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Queue message age alert threshold:</div>
- <div id="brokerAttribute.alertThresholdMessageAge" style="float:left;"></div> ms
+ <div id="brokerAttribute.queue.alertThresholdMessageAge" style="float:left;"></div> ms
</div>
- <div id="brokerAttribute.alertThresholdMessageSize.container" style="clear:both">
+ <div id="brokerAttribute.queue.alertThresholdMessageSize.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Queue message size alert threshold:</div>
- <div id="brokerAttribute.alertThresholdMessageSize" style="float:left;"></div>
+ <div id="brokerAttribute.queue.alertThresholdMessageSize" style="float:left;"></div> bytes
</div>
- <div id="brokerAttribute.alertRepeatGap.container" style="clear:both">
+ <div id="brokerAttribute.queue.alertRepeatGap.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Queue alert repeat gap:</div>
- <div id="brokerAttribute.alertRepeatGap" style="float:left;"></div> ms
+ <div id="brokerAttribute.queue.alertRepeatGap" style="float:left;"></div> ms
</div>
- <div id="brokerAttribute.maximumDeliveryAttempts.container" style="clear:both">
+ <div id="brokerAttribute.queue.maximumDeliveryAttempts.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Queue maximum delivery retries:</div>
- <div id="brokerAttribute.maximumDeliveryAttempts" style="float:left;"></div>
+ <div id="brokerAttribute.queue.maximumDeliveryAttempts" style="float:left;"></div>
</div>
- <div id="brokerAttribute.deadLetterQueueEnabled.container" style="clear:both">
+ <div id="brokerAttribute.queue.deadLetterQueueEnabled.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Dead letter queue enabled:</div>
- <div id="brokerAttribute.deadLetterQueueEnabled" style="float:left;"></div>
+ <div id="brokerAttribute.queue.deadLetterQueueEnabled" style="float:left;"></div>
</div>
- <div id="brokerAttribute.queueFlowControlSizeBytes.container" style="clear:both">
+ <div id="brokerAttribute.queue.flowControlSizeBytes.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Queue flow capacity:</div>
- <div id="brokerAttribute.queueFlowControlSizeBytes" style="float:left;"></div>
+ <div id="brokerAttribute.queue.flowControlSizeBytes" style="float:left;"></div> bytes
</div>
- <div id="brokerAttribute.queueFlowResumeSizeBytes.container" style="clear:both">
+ <div id="brokerAttribute.queue.flowResumeSizeBytes.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Queue flow resume capacity:</div>
- <div id="brokerAttribute.queueFlowResumeSizeBytes" style="float:left;"></div>
+ <div id="brokerAttribute.queue.flowResumeSizeBytes" style="float:left;"></div> bytes
</div>
<div style="clear:both"></div>
</div>
<br/>
- <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Connection attributes', open: true">
- <div id="brokerAttribute.sessionCountLimit.container" style="clear:both">
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Global connection defaults', open: true">
+ <div id="brokerAttribute.connection.sessionCountLimit.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Connection session limit:</div>
- <div id="brokerAttribute.sessionCountLimit" style="float:left;"></div>
+ <div id="brokerAttribute.connection.sessionCountLimit" style="float:left;"></div>
</div>
- <div id="brokerAttribute.heartBeatDelay.container" style="clear:both">
+ <div id="brokerAttribute.connection.heartBeatDelay.container" style="clear:both">
<div class="formLabel-labelCell" style="float:left; width: 250px;">Heart beat delay:</div>
- <div id="brokerAttribute.heartBeatDelay" style="float:left;"></div> ms
+ <div id="brokerAttribute.connection.heartBeatDelay" style="float:left;"></div> ms
+ </div>
+ <div style="clear:both"></div>
+ </div>
+ <br/>
+ <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Global virtual host defaults', open: true">
+ <div id="brokerAttribute.virtualhost.housekeepingCheckPeriod.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">House keeping check period:</div>
+ <div id="brokerAttribute.virtualhost.housekeepingCheckPeriod" style="float:left;"></div>ms
+ </div>
+ <div id="brokerAttribute.virtualhost.storeTransactionIdleTimeoutClose.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">Idle store transaction close timeout:</div>
+ <div id="brokerAttribute.virtualhost.storeTransactionIdleTimeoutClose" style="float:left;"></div>ms
+ </div>
+ <div id="brokerAttribute.virtualhost.storeTransactionIdleTimeoutWarn.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">Idle store transaction warn timeout:</div>
+ <div id="brokerAttribute.virtualhost.storeTransactionIdleTimeoutWarn" style="float:left;"></div>ms
+ </div>
+ <div id="brokerAttribute.virtualhost.storeTransactionOpenTimeoutClose.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">Open store transaction close timeout:</div>
+ <div id="brokerAttribute.virtualhost.storeTransactionOpenTimeoutClose" style="float:left;"></div>ms
+ </div>
+ <div id="brokerAttribute.virtualhost.storeTransactionOpenTimeoutWarn.container" style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 250px;">Open store transaction warn timeout:</div>
+ <div id="brokerAttribute.virtualhost.storeTransactionOpenTimeoutWarn" style="float:left;"></div>ms
</div>
<div style="clear:both"></div>
</div>
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
index e4ea16fc5b..bc4932ea09 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
@@ -182,7 +182,7 @@ public class VirtualHostConfiguration extends AbstractConfiguration
public Long getMaximumQueueDepth()
{
- return getLongValue("queues.maximumQueueDepth", getBrokerAttributeAsLong(Broker.ALERT_THRESHOLD_QUEUE_DEPTH));
+ return getLongValue("queues.maximumQueueDepth", getBrokerAttributeAsLong(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES));
}
public Long getMaximumMessageSize()
@@ -192,7 +192,7 @@ public class VirtualHostConfiguration extends AbstractConfiguration
public Long getMaximumMessageCount()
{
- return getLongValue("queues.maximumMessageCount", getBrokerAttributeAsLong(Broker.ALERT_THRESHOLD_MESSAGE_COUNT));
+ return getLongValue("queues.maximumMessageCount", getBrokerAttributeAsLong(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES));
}
public Long getMinimumAlertRepeatGap()
@@ -243,22 +243,26 @@ public class VirtualHostConfiguration extends AbstractConfiguration
public long getTransactionTimeoutOpenWarn()
{
- return getLongValue("transactionTimeout.openWarn", 0L);
+ return getLongValue("transactionTimeout.openWarn",
+ getBrokerAttributeAsLong(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN));
}
public long getTransactionTimeoutOpenClose()
{
- return getLongValue("transactionTimeout.openClose", 0L);
+ return getLongValue("transactionTimeout.openClose",
+ getBrokerAttributeAsLong(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE));
}
public long getTransactionTimeoutIdleWarn()
{
- return getLongValue("transactionTimeout.idleWarn", 0L);
+ return getLongValue("transactionTimeout.idleWarn",
+ getBrokerAttributeAsLong(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN));
}
public long getTransactionTimeoutIdleClose()
{
- return getLongValue("transactionTimeout.idleClose", 0L);
+ return getLongValue("transactionTimeout.idleClose",
+ getBrokerAttributeAsLong(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE));
}
public int getMaxDeliveryCount()
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
index 21a22d032d..e83017d201 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/Broker.java
@@ -56,19 +56,19 @@ public interface Broker extends ConfiguredObject
String DEFAULT_AUTHENTICATION_PROVIDER = "defaultAuthenticationProvider";
String DEFAULT_VIRTUAL_HOST = "defaultVirtualHost";
- String ALERT_THRESHOLD_MESSAGE_AGE = "alertThresholdMessageAge";
- String ALERT_THRESHOLD_MESSAGE_COUNT = "alertThresholdMessageCount";
- String ALERT_THRESHOLD_QUEUE_DEPTH = "alertThresholdQueueDepth";
- String ALERT_THRESHOLD_MESSAGE_SIZE = "alertThresholdMessageSize";
- String ALERT_REPEAT_GAP = "alertRepeatGap";
- String FLOW_CONTROL_SIZE_BYTES = "queueFlowControlSizeBytes";
- String FLOW_CONTROL_RESUME_SIZE_BYTES = "queueFlowResumeSizeBytes";
- String MAXIMUM_DELIVERY_ATTEMPTS = "maximumDeliveryAttempts";
- String DEAD_LETTER_QUEUE_ENABLED = "deadLetterQueueEnabled";
- String HOUSEKEEPING_CHECK_PERIOD = "housekeepingCheckPeriod";
-
- String SESSION_COUNT_LIMIT = "sessionCountLimit";
- String HEART_BEAT_DELAY = "heartBeatDelay";
+ String ALERT_THRESHOLD_MESSAGE_AGE = "queue.alertThresholdMessageAge";
+ String ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES = "queue.alertThresholdQueueDepthMessages";
+ String ALERT_THRESHOLD_QUEUE_DEPTH_BYTES = "queue.alertThresholdQueueDepthBytes";
+ String ALERT_THRESHOLD_MESSAGE_SIZE = "queue.alertThresholdMessageSize";
+ String ALERT_REPEAT_GAP = "queue.alertRepeatGap";
+ String FLOW_CONTROL_SIZE_BYTES = "queue.flowControlSizeBytes";
+ String FLOW_CONTROL_RESUME_SIZE_BYTES = "queue.flowResumeSizeBytes";
+ String MAXIMUM_DELIVERY_ATTEMPTS = "queue.maximumDeliveryAttempts";
+ String DEAD_LETTER_QUEUE_ENABLED = "queue.deadLetterQueueEnabled";
+ String HOUSEKEEPING_CHECK_PERIOD = "virtualhost.housekeepingCheckPeriod";
+
+ String SESSION_COUNT_LIMIT = "connection.sessionCountLimit";
+ String HEART_BEAT_DELAY = "connection.heartBeatDelay";
String STATISTICS_REPORTING_PERIOD = "statisticsReportingPeriod";
String STATISTICS_REPORTING_RESET_ENABLED = "statisticsReportingResetEnabled";
String STORE_TYPE = "storeType";
@@ -76,6 +76,10 @@ public interface Broker extends ConfiguredObject
String STORE_PATH = "storePath";
String MANAGEMENT_VERSION = "managementVersion";
+ String VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE = "virtualhost.storeTransactionIdleTimeoutClose";
+ String VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN = "virtualhost.storeTransactionIdleTimeoutWarn";
+ String VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE = "virtualhost.storeTransactionOpenTimeoutClose";
+ String VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN = "virtualhost.storeTransactionOpenTimeoutWarn";
/*
* A temporary attribute to pass the path to ACL file.
* TODO: It should be a part of AuthorizationProvider.
@@ -122,8 +126,8 @@ public interface Broker extends ConfiguredObject
DEFAULT_AUTHENTICATION_PROVIDER,
DEFAULT_VIRTUAL_HOST,
ALERT_THRESHOLD_MESSAGE_AGE,
- ALERT_THRESHOLD_MESSAGE_COUNT,
- ALERT_THRESHOLD_QUEUE_DEPTH,
+ ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES,
+ ALERT_THRESHOLD_QUEUE_DEPTH_BYTES,
ALERT_THRESHOLD_MESSAGE_SIZE,
ALERT_REPEAT_GAP,
FLOW_CONTROL_SIZE_BYTES,
@@ -139,6 +143,10 @@ public interface Broker extends ConfiguredObject
STORE_VERSION,
STORE_PATH,
MANAGEMENT_VERSION,
+ VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE,
+ VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN,
+ VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE,
+ VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN,
ACL_FILE,
KEY_STORE_PATH,
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
index 6741b3328d..c6e33cbad5 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/VirtualHost.java
@@ -57,16 +57,16 @@ public interface VirtualHost extends ConfiguredObject
XA_TRANSACTION_BRANCH_ENDS, XA_TRANSACTION_BRANCH_STARTS, XA_TRANSACTION_BRANCH_SUSPENDS,
QUEUE_COUNT, EXCHANGE_COUNT, CONNECTION_COUNT));
- String ALERT_REPEAT_GAP = "alertRepeatGap";
- String ALERT_THRESHOLD_MESSAGE_AGE = "alertThresholdMessageAge";
- String ALERT_THRESHOLD_MESSAGE_SIZE = "alertThresholdMessageSize";
- String ALERT_THRESHOLD_QUEUE_DEPTH_BYTES = "alertThresholdQueueDepthBytes";
- String ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES = "alertThresholdQueueDepthMessages";
- String DEAD_LETTER_QUEUE_ENABLED = "deadLetterQueueEnabled";
+ String ALERT_REPEAT_GAP = "queue.alertRepeatGap";
+ String ALERT_THRESHOLD_MESSAGE_AGE = "queue.alertThresholdMessageAge";
+ String ALERT_THRESHOLD_MESSAGE_SIZE = "queue.alertThresholdMessageSize";
+ String ALERT_THRESHOLD_QUEUE_DEPTH_BYTES = "queue.alertThresholdQueueDepthBytes";
+ String ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES = "queue.alertThresholdQueueDepthMessages";
+ String DEAD_LETTER_QUEUE_ENABLED = "queue.deadLetterQueueEnabled";
String HOUSEKEEPING_CHECK_PERIOD = "housekeepingCheckPeriod";
- String MAXIMUM_DELIVERY_ATTEMPTS = "maximumDeliveryAttempts";
- String QUEUE_FLOW_CONTROL_SIZE_BYTES = "queueFlowControlSizeBytes";
- String QUEUE_FLOW_RESUME_SIZE_BYTES = "queueFlowResumeSizeBytes";
+ String MAXIMUM_DELIVERY_ATTEMPTS = "queue.maximumDeliveryAttempts";
+ String QUEUE_FLOW_CONTROL_SIZE_BYTES = "queue.flowControlSizeBytes";
+ String QUEUE_FLOW_RESUME_SIZE_BYTES = "queue.flowResumeSizeBytes";
String STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE = "storeTransactionIdleTimeoutClose";
String STORE_TRANSACTION_IDLE_TIMEOUT_WARN = "storeTransactionIdleTimeoutWarn";
String STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE = "storeTransactionOpenTimeoutClose";
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
index 73706904e5..841dfb8229 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
@@ -79,8 +79,8 @@ public class BrokerAdapter extends AbstractAdapter implements Broker, Configurat
@SuppressWarnings("serial")
public static final Map<String, Type> ATTRIBUTE_TYPES = Collections.unmodifiableMap(new HashMap<String, Type>(){{
put(ALERT_THRESHOLD_MESSAGE_AGE, Long.class);
- put(ALERT_THRESHOLD_MESSAGE_COUNT, Long.class);
- put(ALERT_THRESHOLD_QUEUE_DEPTH, Long.class);
+ put(ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, Long.class);
+ put(ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, Long.class);
put(ALERT_THRESHOLD_MESSAGE_SIZE, Long.class);
put(ALERT_REPEAT_GAP, Long.class);
put(FLOW_CONTROL_SIZE_BYTES, Long.class);
@@ -108,6 +108,10 @@ public class BrokerAdapter extends AbstractAdapter implements Broker, Configurat
put(PEER_STORE_PATH, String.class);
put(PEER_STORE_PASSWORD, String.class);
put(GROUP_FILE, String.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, Long.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, Long.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, Long.class);
+ put(VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, Long.class);
}});
public static final int DEFAULT_STATISTICS_REPORTING_PERIOD = 0;
@@ -125,6 +129,10 @@ public class BrokerAdapter extends AbstractAdapter implements Broker, Configurat
public static final int DEFAULT_HEART_BEAT_DELAY = 0;
public static final int DEFAULT_SESSION_COUNT_LIMIT = 256;
public static final String DEFAULT_NAME = "QpidBroker";
+ public static final long DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE = 0l;
+ public static final long DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_WARN = 0l;
+ public static final long DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE = 0l;
+ public static final long DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_WARN = 0l;
private static final String DEFAULT_KEY_STORE_NAME = "defaultKeyStore";
private static final String DEFAULT_TRUST_STORE_NAME = "defaultTrustStore";
private static final String DEFAULT_GROUP_PROFIDER_NAME = "defaultGroupProvider";
@@ -138,9 +146,9 @@ public class BrokerAdapter extends AbstractAdapter implements Broker, Configurat
put(Broker.STATISTICS_REPORTING_RESET_ENABLED, DEFAULT_STATISTICS_REPORTING_RESET_ENABLED);
put(Broker.ALERT_REPEAT_GAP, DEFAULT_ALERT_REPEAT_GAP);
put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, DEFAULT_ALERT_THRESHOLD_MESSAGE_AGE);
- put(Broker.ALERT_THRESHOLD_MESSAGE_COUNT, DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT);
+ put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, DEFAULT_ALERT_THRESHOLD_MESSAGE_COUNT);
put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, DEFAULT_ALERT_THRESHOLD_MESSAGE_SIZE);
- put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH, DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH);
+ put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, DEFAULT_ALERT_THRESHOLD_QUEUE_DEPTH);
put(Broker.DEAD_LETTER_QUEUE_ENABLED, DEFAULT_DEAD_LETTER_QUEUE_ENABLED);
put(Broker.MAXIMUM_DELIVERY_ATTEMPTS, DEFAULT_MAXIMUM_DELIVERY_ATTEMPTS);
put(Broker.FLOW_CONTROL_RESUME_SIZE_BYTES, DEFAULT_FLOW_CONTROL_RESUME_SIZE_BYTES);
@@ -149,12 +157,18 @@ public class BrokerAdapter extends AbstractAdapter implements Broker, Configurat
put(Broker.HEART_BEAT_DELAY, DEFAULT_HEART_BEAT_DELAY);
put(Broker.SESSION_COUNT_LIMIT, DEFAULT_SESSION_COUNT_LIMIT);
put(Broker.NAME, DEFAULT_NAME);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, DEFAULT_STORE_TRANSACTION_IDLE_TIMEOUT_WARN);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE);
+ put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, DEFAULT_STORE_TRANSACTION_OPEN_TIMEOUT_WARN);
}});
- private String[] POSITIVE_NUMERIC_ATTRIBUTES = { ALERT_THRESHOLD_MESSAGE_AGE, ALERT_THRESHOLD_MESSAGE_COUNT,
- ALERT_THRESHOLD_QUEUE_DEPTH, ALERT_THRESHOLD_MESSAGE_SIZE, ALERT_REPEAT_GAP, FLOW_CONTROL_SIZE_BYTES,
+ private String[] POSITIVE_NUMERIC_ATTRIBUTES = { ALERT_THRESHOLD_MESSAGE_AGE, ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES,
+ ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, ALERT_THRESHOLD_MESSAGE_SIZE, ALERT_REPEAT_GAP, FLOW_CONTROL_SIZE_BYTES,
FLOW_CONTROL_RESUME_SIZE_BYTES, MAXIMUM_DELIVERY_ATTEMPTS, HOUSEKEEPING_CHECK_PERIOD, SESSION_COUNT_LIMIT,
- HEART_BEAT_DELAY, STATISTICS_REPORTING_PERIOD };
+ HEART_BEAT_DELAY, STATISTICS_REPORTING_PERIOD, VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE,
+ VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE,
+ VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN};
private final StatisticsGatherer _statisticsGatherer;
@@ -1028,9 +1042,9 @@ public class BrokerAdapter extends AbstractAdapter implements Broker, Configurat
Collection<String> names = AVAILABLE_ATTRIBUTES;
for (String name : names)
{
- if (attributes.containsKey(name))
+ if (convertedAttributes.containsKey(name))
{
- Object desired = attributes.get(name);
+ Object desired = convertedAttributes.get(name);
Object expected = getAttribute(name);
if (changeAttribute(name, expected, desired))
{
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
index 570bd004c5..b3b637c81e 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
@@ -357,4 +357,52 @@ public class VirtualHostConfigurationTest extends QpidTestCase
// Check, that the property stored within the <dot.in.a.name> tag has been properly loaded
assertEquals("virtual host with dots in the name has been properly loaded", TestableMemoryMessageStore.class.getName(), test.getMessageStore().getClass().getName());
}
+
+ public void testStoreTransactionIdleTimeoutClose() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionIdleTimeoutClose value", 0, vhost.getConfiguration().getTransactionTimeoutIdleClose());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutClose value", 1000l, vhost.getConfiguration().getTransactionTimeoutIdleClose());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.idleClose", 2000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutClose value", 2000l, vhost.getConfiguration().getTransactionTimeoutIdleClose());
+ }
+
+ public void testStoreTransactionIdleTimeoutWarn() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionIdleTimeoutWarn value", 0, vhost.getConfiguration().getTransactionTimeoutIdleWarn());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutWarn value", 1000l, vhost.getConfiguration().getTransactionTimeoutIdleWarn());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.idleWarn", 2000l);
+ assertEquals("Unexpected StoreTransactionIdleTimeoutWarn value", 2000l, vhost.getConfiguration().getTransactionTimeoutIdleWarn());
+ }
+
+ public void testStoreTransactionOpenTimeoutClose() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionOpenTimeoutClose value", 0, vhost.getConfiguration().getTransactionTimeoutOpenClose());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutClose value", 1000l, vhost.getConfiguration().getTransactionTimeoutOpenClose());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.openClose", 2000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutClose value", 2000l, vhost.getConfiguration().getTransactionTimeoutOpenClose());
+ }
+
+ public void testStoreTransactionOpenTimeoutWarn() throws Exception
+ {
+ VirtualHost vhost = createVirtualHost(getName());
+ assertEquals("Unexpected StoreTransactionOpenTimeoutWarn value", 0, vhost.getConfiguration().getTransactionTimeoutOpenWarn());
+
+ when(_broker.getAttribute(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN)).thenReturn(1000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutWarn value", 1000l, vhost.getConfiguration().getTransactionTimeoutOpenWarn());
+
+ vhost.getConfiguration().getConfig().setProperty("transactionTimeout.openWarn", 2000l);
+ assertEquals("Unexpected StoreTransactionOpenTimeoutWarn value", 2000l, vhost.getConfiguration().getTransactionTimeoutOpenWarn());
+ }
}
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
index 79dcf0cac4..facd4e63ef 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/startup/BrokerRecovererTest.java
@@ -91,8 +91,8 @@ public class BrokerRecovererTest extends TestCase
attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
attributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 9l);
- attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_COUNT, 8l);
- attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH, 7l);
+ attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8l);
+ attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7l);
attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 6l);
attributes.put(Broker.ALERT_REPEAT_GAP, 5l);
attributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 5l);
diff --git a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
index 9d7f6a9cc1..013daefce4 100644
--- a/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
+++ b/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
@@ -62,8 +62,8 @@ public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase
_brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
_brokerAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
_brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 9);
- _brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_COUNT, 8);
- _brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH, 7);
+ _brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 8);
+ _brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 7);
_brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 6);
_brokerAttributes.put(Broker.ALERT_REPEAT_GAP, 5);
_brokerAttributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 5);
@@ -173,8 +173,8 @@ public abstract class ConfigurationEntryStoreTestCase extends QpidTestCase
attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "test");
attributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "authenticationProvider1");
attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 19);
- attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_COUNT, 18);
- attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH, 17);
+ attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 18);
+ attributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 17);
attributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 16);
attributes.put(Broker.ALERT_REPEAT_GAP, 15);
attributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 15);
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
index fe4115b4c0..e03275366e 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
@@ -34,7 +34,6 @@ import org.apache.qpid.server.model.LifetimePolicy;
import org.apache.qpid.server.model.Port;
import org.apache.qpid.server.model.State;
import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.model.adapter.BrokerAdapter;
import org.apache.qpid.test.utils.QpidTestCase;
import org.apache.qpid.test.utils.TestBrokerConfiguration;
import org.apache.qpid.test.utils.TestSSLConstants;
@@ -103,14 +102,36 @@ public class BrokerRestTest extends QpidRestTestCase
assertBrokerAttributes(brokerAttributes, brokerDetails);
}
+ public void testPutUpdateWhereNumericAttributesAreSetAsStringValues() throws Exception
+ {
+ Map<String, Object> validAttributes = getValidBrokerAttributes();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+
+ for (Map.Entry<String, Object> entry : validAttributes.entrySet())
+ {
+ Object value = entry.getValue();
+ if (value instanceof Number)
+ {
+ value = String.valueOf(value);
+ }
+ attributes.put(entry.getKey(), value);
+ }
+
+ int response = getRestTestHelper().submitRequest("/rest/broker", "PUT", attributes);
+ assertEquals("Unexpected update response", 200, response);
+
+ Map<String, Object> brokerDetails = getRestTestHelper().getJsonAsSingletonList("/rest/broker");
+ assertBrokerAttributes(validAttributes, brokerDetails);
+ }
+
public void testPutToUpdateWithInvalidAttributeValues() throws Exception
{
Map<String, Object> invalidAttributes = new HashMap<String, Object>();
invalidAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, "non-existing-provider");
invalidAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, "non-existing-host");
invalidAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, -1000);
- invalidAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_COUNT, -2000);
- invalidAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH, -3000);
+ invalidAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, -2000);
+ invalidAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, -3000);
invalidAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, -4000);
invalidAttributes.put(Broker.ALERT_REPEAT_GAP, -5000);
invalidAttributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, -7000);
@@ -129,6 +150,10 @@ public class BrokerRestTest extends QpidRestTestCase
invalidAttributes.put(Broker.PEER_STORE_PATH, QpidTestCase.QPID_HOME + File.separator + "etc" + File.separator + "non-existing-peerstore.jks");
invalidAttributes.put(Broker.PEER_STORE_PASSWORD, "password3");
invalidAttributes.put(Broker.GROUP_FILE, QpidTestCase.QPID_HOME + File.separator + "etc" + File.separator + "groups-non-existing");
+ invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, -13000);
+ invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, -14000);
+ invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, -15000);
+ invalidAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, -16000);
for (Map.Entry<String, Object> entry : invalidAttributes.entrySet())
{
@@ -152,8 +177,8 @@ public class BrokerRestTest extends QpidRestTestCase
brokerAttributes.put(Broker.DEFAULT_AUTHENTICATION_PROVIDER, ANONYMOUS_AUTHENTICATION_PROVIDER);
brokerAttributes.put(Broker.DEFAULT_VIRTUAL_HOST, TEST3_VIRTUALHOST);
brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_AGE, 1000);
- brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_COUNT, 2000);
- brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH, 3000);
+ brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 2000);
+ brokerAttributes.put(Broker.ALERT_THRESHOLD_QUEUE_DEPTH_BYTES, 3000);
brokerAttributes.put(Broker.ALERT_THRESHOLD_MESSAGE_SIZE, 4000);
brokerAttributes.put(Broker.ALERT_REPEAT_GAP, 5000);
brokerAttributes.put(Broker.FLOW_CONTROL_SIZE_BYTES, 7000);
@@ -174,6 +199,10 @@ public class BrokerRestTest extends QpidRestTestCase
brokerAttributes.put(Broker.PEER_STORE_PATH, TestSSLConstants.TRUSTSTORE);
brokerAttributes.put(Broker.PEER_STORE_PASSWORD, TestSSLConstants.TRUSTSTORE_PASSWORD);
brokerAttributes.put(Broker.GROUP_FILE, QpidTestCase.QPID_HOME + File.separator + "etc" + File.separator + "groups");
+ brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_CLOSE, 13000);
+ brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_IDLE_TIMEOUT_WARN, 14000);
+ brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_CLOSE, 15000);
+ brokerAttributes.put(Broker.VIRTUALHOST_STORE_TRANSACTION_OPEN_TIMEOUT_WARN, 16000);
return brokerAttributes;
}