You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2013/04/04 14:25:41 UTC

svn commit: r1464498 - in /qpid/branches/0.22/qpid/java: ./ broker-plugins/management-http/src/main/java/resources/ broker-plugins/management-http/src/main/java/resources/js/qpid/common/ broker-plugins/management-http/src/main/java/resources/js/qpid/ma...

Author: orudyy
Date: Thu Apr  4 12:25:41 2013
New Revision: 1464498

URL: http://svn.apache.org/r1464498
Log:
QPID-4696: Group broker attributes on editing UI, improve attribute descriptions, add attributes units.
               Remove obsolete GroupPrincipalAccessor.
               Fix flow control attribute validation.
               Fix constant name for default group provider attribute.
               Remove redundant comments.
    
merged from trunk r1464115 and r1464362

Removed:
    qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/security/group/GroupPrincipalAccessor.java
    qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/group/GroupPrincipalAccessorTest.java
Modified:
    qpid/branches/0.22/qpid/java/   (props changed)
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
    qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
    qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
    qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
    qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
    qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java
    qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java

Propchange: qpid/branches/0.22/qpid/java/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java:r1464115,1464362

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js Thu Apr  4 12:25:41 2013
@@ -26,6 +26,7 @@ define(["dojo/_base/xhr",
         "dojo/dom-construct",
         "dojo/dom-geometry",
         "dojo/window",
+        "dijit/TitlePane",
         "dijit/Dialog",
         "dijit/form/Form",
         "dijit/form/Button",
@@ -163,6 +164,7 @@ define(["dojo/_base/xhr",
 
               var widgets = {};
               var requiredFor ={};
+              var groups = {};
               for(var i in attributeWidgetFactories)
               {
                  var attributeWidgetFactory = attributeWidgetFactories[i];
@@ -170,7 +172,37 @@ define(["dojo/_base/xhr",
                  var name = attributeWidgetFactory.name ? attributeWidgetFactory.name : widget.name;
                  widgets[name] = widget;
                  widget.initialValue = widget.value;
-                 layout.addChild(widget);
+                 var dotPos = name.indexOf(".");
+                 if (dotPos == -1)
+                 {
+                   layout.addChild(widget);
+                 }
+                 else
+                 {
+                   var groupName = name.substring(0, dotPos);
+                   var groupFieldContainer = null;
+                   if (groups.hasOwnProperty(groupName))
+                   {
+                       groupFieldContainer = groups[groupName];
+                   }
+                   else
+                   {
+                     groupFieldContainer = new dojox.layout.TableContainer({
+                           cols: 1,
+                           "labelWidth": "290",
+                           showLabels: true,
+                           orientation: "horiz",
+                           customClass: "formLabel"
+                      });
+                     groups[groupName] = groupFieldContainer;
+                     var groupTitle = attributeWidgetFactory.groupName ? attributeWidgetFactory.groupName :
+                                         groupName.charAt(0).toUpperCase() + groupName.slice(1);
+                     var panel = new dijit.TitlePane({title: groupTitle, toggleable: false, content: groupFieldContainer.domNode});
+                     dialogContentArea.appendChild(dom.create("br"));
+                     dialogContentArea.appendChild(panel.domNode);
+                   }
+                   groupFieldContainer.addChild(widget);
+                 }
                  if (attributeWidgetFactory.hasOwnProperty("requiredFor") && !data[name])
                  {
                    requiredFor[attributeWidgetFactory.requiredFor] = widget;
@@ -249,7 +281,7 @@ define(["dojo/_base/xhr",
              form.connectChildren(true);
              setAttributesDialog.startup();
              setAttributesDialog.on("show", function(){
-               var data = geometry.position(layout.domNode);
+               var data = geometry.position(dialogContentArea);
                var maxHeight = win.getBox().h * 0.6;
                if (data.h > maxHeight)
                {

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js Thu Apr  4 12:25:41 2013
@@ -125,15 +125,6 @@ define(["dojo/_base/xhr",
                              name: "keyStorePath"});
                        }
                }, {
-                       name: "keyStoreCertAlias",
-                       createWidget: function(brokerData) {
-                           return new dijit.form.ValidationTextBox({
-                             required: false,
-                             value: brokerData.keyStoreCertAlias,
-                             label: "Keystore certificate alias:",
-                             name: "keyStoreCertAlias"});
-                       }
-               }, {
                        name: "keyStorePassword",
                        requiredFor: "keyStorePath",
                        createWidget: function(brokerData) {
@@ -146,6 +137,15 @@ define(["dojo/_base/xhr",
                              });
                        }
                }, {
+                       name: "keyStoreCertAlias",
+                       createWidget: function(brokerData) {
+                           return new dijit.form.ValidationTextBox({
+                             required: false,
+                             value: brokerData.keyStoreCertAlias,
+                             label: "Keystore certificate alias:",
+                             name: "keyStoreCertAlias"});
+                       }
+               }, {
                        name: "trustStorePath",
                        createWidget: function(brokerData)
                        {
@@ -189,7 +189,32 @@ define(["dojo/_base/xhr",
                          });
                        }
                }, {
+                       name: "statisticsReportingPeriod",
+                       createWidget: function(brokerData) {
+                         return new dijit.form.ValidationTextBox({
+                           trim: "true",
+                           regexp: "[0-9]+",
+                           invalidMessage: "Invalid value",
+                           required: false,
+                           value: brokerData.statisticsReportingPeriod,
+                           placeholder: "Time in ms",
+                           label: "Statistics reporting period (ms):",
+                           name: "statisticsReportingPeriod"
+                         });
+                       }
+               }, {
+                       name: "statisticsReportingResetEnabled",
+                       createWidget: function(brokerData)
+                       {
+                         return new dijit.form.CheckBox({
+                           required: false, checked: brokerData.statisticsReportingResetEnabled, value: "true",
+                           label: "Statistics reporting period enabled:",
+                           name: "statisticsReportingResetEnabled"
+                         });
+                       }
+               }, {
                        name: "queue.alertThresholdQueueDepthMessages",
+                       groupName: "Global Queue Defaults",
                        createWidget: function(brokerData) {
                          return new dijit.form.ValidationTextBox({
                            trim: "true",
@@ -197,8 +222,8 @@ define(["dojo/_base/xhr",
                            invalidMessage: "Invalid value",
                            required: false,
                            value: brokerData["queue.alertThresholdQueueDepthMessages"],
-                           placeholder: "Count of messages",
-                           label: "Queue depth messages alert threshold:",
+                           placeholder: "Number of messages",
+                           label: "Depth alert threshold (messages):",
                            name: "queue.alertThresholdQueueDepthMessages"
                          });
                        }
@@ -212,7 +237,7 @@ define(["dojo/_base/xhr",
                          required: false,
                          value: brokerData["queue.alertThresholdQueueDepthBytes"],
                          placeholder: "Number of bytes",
-                         label: "Queue depth bytes alert threshold:",
+                         label: "Depth alert threshold (bytes):",
                          name: "queue.alertThresholdQueueDepthBytes"
                        });
                      }
@@ -226,7 +251,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["queue.alertThresholdMessageAge"],
                            placeholder: "Time in ms",
-                           label: "Queue message age alert threshold:",
+                           label: "Message age alert threshold (ms):",
                            name: "queue.alertThresholdMessageAge"
                          });
                        }
@@ -240,7 +265,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["queue.alertThresholdMessageSize"],
                            placeholder: "Size in bytes",
-                           label: "Queue message size alert threshold:",
+                           label: "Message size alert threshold (bytes):",
                            name: "queue.alertThresholdMessageSize"
                          });
                        }
@@ -254,7 +279,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["queue.alertRepeatGap"],
                            placeholder: "Time in ms",
-                           label: "Queue alert repeat gap:",
+                           label: "Alert repeat gap (ms):",
                            name: "queue.alertRepeatGap"
                          });
                        }
@@ -267,8 +292,8 @@ define(["dojo/_base/xhr",
                            invalidMessage: "Invalid value",
                            required: false,
                            value: brokerData["queue.maximumDeliveryAttempts"],
-                           placeholder: "Count of messages",
-                           label: "Queue maximum delivery retries:",
+                           placeholder: "Number of messages",
+                           label: "Maximum delivery retries (messages):",
                            name: "queue.maximumDeliveryAttempts"
                          });
                        }
@@ -293,7 +318,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["queue.flowControlSizeBytes"],
                            placeholder: "Size in bytes",
-                           label: "Queue flow capacity:",
+                           label: "Flow control threshold (bytes):",
                            name: "queue.flowControlSizeBytes",
                          });
                        }
@@ -307,12 +332,13 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["queue.flowResumeSizeBytes"],
                            placeholder: "Size in bytes",
-                           label: "Queue flow resume capacity:",
+                           label: "Flow resume threshold (bytes):",
                            name: "queue.flowResumeSizeBytes",
                          });
                        }
                }, {
                        name: "connection.sessionCountLimit",
+                       groupName: "Global Connection Defaults",
                        createWidget: function(brokerData)
                        {
                          return new dijit.form.NumberSpinner({
@@ -321,7 +347,7 @@ define(["dojo/_base/xhr",
                            value: brokerData["connection.sessionCountLimit"],
                            smallDelta: 1,
                            constraints: {min:1,max:65535,places:0, pattern: "#####"},
-                           label: "Connection session limit:",
+                           label: "Maximum number of sessions:",
                            name: "connection.sessionCountLimit"
                          });
                        }
@@ -335,36 +361,13 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["connection.heartBeatDelay"],
                            placeholder: "Time in ms",
-                           label: "Heart beat delay:",
+                           label: "Heart beat delay (ms):",
                            name: "connection.heartBeatDelay"
                          });
                        }
                }, {
-                       name: "statisticsReportingPeriod",
-                       createWidget: function(brokerData) {
-                         return new dijit.form.ValidationTextBox({
-                           trim: "true",
-                           regexp: "[0-9]+",
-                           invalidMessage: "Invalid value",
-                           required: false,
-                           value: brokerData.statisticsReportingPeriod,
-                           placeholder: "Time in ms",
-                           label: "Statistics reporting period:",
-                           name: "statisticsReportingPeriod"
-                         });
-                       }
-               }, {
-                       name: "statisticsReportingResetEnabled",
-                       createWidget: function(brokerData)
-                       {
-                         return new dijit.form.CheckBox({
-                           required: false, checked: brokerData.statisticsReportingResetEnabled, value: "true",
-                           label: "Statistics reporting period enabled:",
-                           name: "statisticsReportingResetEnabled"
-                         });
-                       }
-               }, {
                        name: "virtualhost.housekeepingCheckPeriod",
+                       groupName: "Global Virtual Host defaults",
                        createWidget: function(brokerData) {
                          return new dijit.form.ValidationTextBox({
                            trim: "true",
@@ -373,7 +376,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["virtualhost.housekeepingCheckPeriod"],
                            placeholder: "Time in ms",
-                           label: "House keeping check period:",
+                           label: "House keeping check period (ms):",
                            name: "virtualhost.housekeepingCheckPeriod"
                          });
                        }
@@ -387,7 +390,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["virtualhost.storeTransactionIdleTimeoutClose"],
                            placeholder: "Time in ms",
-                           label: "Idle store transaction close timeout:",
+                           label: "Idle store transaction close timeout (ms):",
                            name: "virtualhost.storeTransactionIdleTimeoutClose"
                          });
                        }
@@ -401,7 +404,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["virtualhost.storeTransactionIdleTimeoutWarn"],
                            placeholder: "Time in ms",
-                           label: "Idle store transaction warn timeout:",
+                           label: "Idle store transaction warn timeout (ms):",
                            name: "virtualhost.storeTransactionIdleTimeoutWarn"
                          });
                        }
@@ -415,7 +418,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["virtualhost.storeTransactionOpenTimeoutClose"],
                            placeholder: "Time in ms",
-                           label: "Open store transaction close timeout:",
+                           label: "Open store transaction close timeout (ms):",
                            name: "virtualhost.storeTransactionOpenTimeoutClose"
                          });
                        }
@@ -429,7 +432,7 @@ define(["dojo/_base/xhr",
                            required: false,
                            value: brokerData["virtualhost.storeTransactionOpenTimeoutWarn"],
                            placeholder: "Time in ms",
-                           label: "Open store transaction warn timeout:",
+                           label: "Open store transaction warn timeout (ms):",
                            name: "virtualhost.storeTransactionOpenTimeoutWarn"
                          });
                        }
@@ -530,7 +533,6 @@ define(["dojo/_base/xhr",
 
                              util.flattenStatistics( that.brokerData);
 
-                             that.showReadOnlyAttributes();
                              that.updateHeader();
 
                              var gridProperties = {
@@ -655,6 +657,7 @@ define(["dojo/_base/xhr",
 
            BrokerUpdater.prototype.updateHeader = function()
            {
+               this.showReadOnlyAttributes();
                var brokerData = this.brokerData;
                for(var i in this.attributes)
                {
@@ -715,7 +718,7 @@ define(["dojo/_base/xhr",
                dojo.byId("brokerAttribute.operatingSystem").innerHTML = brokerData.operatingSystem;
                dojo.byId("brokerAttribute.platform").innerHTML = brokerData.platform;
                dojo.byId("brokerAttribute.productVersion").innerHTML = brokerData.productVersion;
-               dojo.byId("brokerAttribute.managementVersion").innerHTML = brokerData.managementVersion;
+               dojo.byId("brokerAttribute.modelVersion").innerHTML = brokerData.managementVersion;
                dojo.byId("brokerAttribute.storeType").innerHTML = brokerData.storeType;
                dojo.byId("brokerAttribute.storeVersion").innerHTML = brokerData.storeVersion;
                dojo.byId("brokerAttribute.storePath").innerHTML = brokerData.storePath;

Modified: qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html (original)
+++ qpid/branches/0.22/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html Thu Apr  4 12:25:41 2013
@@ -37,9 +37,9 @@
                 <div class="formLabel-labelCell" style="float:left; width: 250px;">Broker version:</div>
                 <div id="brokerAttribute.productVersion" style="float:left;"></div>
             </div>
-            <div id="brokerAttribute.managementVersion.container" style="clear:both">
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">Broker management version:</div>
-                <div id="brokerAttribute.managementVersion" style="float:left;"></div>
+            <div id="brokerAttribute.modelVersion.container" style="clear:both">
+                <div class="formLabel-labelCell" style="float:left; width: 250px;">Broker model version:</div>
+                <div id="brokerAttribute.modelVersion" style="float:left;"></div>
             </div>
             <div id="brokerAttribute.storeType.container" style="clear:both">
                 <div class="formLabel-labelCell" style="float:left; width: 250px;">Broker store type:</div>
@@ -72,7 +72,7 @@
             <div id="brokerAttribute.keyStorePath.container" style="display: none; clear:both">
                 <div class="formLabel-labelCell" style="float:left; width: 250px;">Path to keystore:</div>
                 <div id="brokerAttribute.keyStorePath" style="float:left;"></div><br/>
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">Keystore alias:</div>
+                <div class="formLabel-labelCell" style="float:left; width: 250px;">Keystore certificate alias:</div>
                 <div id="brokerAttribute.keyStoreCertAlias" style="float:left;"></div>
             </div>
             <div id="brokerAttribute.trustStorePath.container" style="display: none; clear:both">
@@ -95,75 +95,75 @@
             <br/>
             <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 class="formLabel-labelCell" style="float:left; width: 240px;">Depth messages alert threshold:</div>
                     <div id="brokerAttribute.queue.alertThresholdQueueDepthMessages" style="float:left;"></div>
                 </div>
                 <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 class="formLabel-labelCell" style="float:left; width: 240px;">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 class="formLabel-labelCell" style="float:left; width: 240px;">Message age alert threshold:</div>
                     <div id="brokerAttribute.queue.alertThresholdMessageAge" style="float:left;"></div> ms
                 </div>
                 <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 class="formLabel-labelCell" style="float:left; width: 240px;">Message size alert threshold:</div>
                     <div id="brokerAttribute.queue.alertThresholdMessageSize" style="float:left;"></div> bytes
                 </div>
                 <div id="brokerAttribute.queue.alertRepeatGap.container" style="clear:both">
-                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue alert repeat gap:</div>
+                    <div class="formLabel-labelCell" style="float:left; width: 240px;">Alert repeat gap:</div>
                     <div id="brokerAttribute.queue.alertRepeatGap" style="float:left;"></div> ms
                 </div>
                 <div id="brokerAttribute.queue.maximumDeliveryAttempts.container" style="clear:both">
-                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue maximum delivery retries:</div>
+                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Maximum delivery retries:</div>
                     <div id="brokerAttribute.queue.maximumDeliveryAttempts" style="float:left;"></div>
                 </div>
                 <div id="brokerAttribute.queue.deadLetterQueueEnabled.container" style="clear:both">
-                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Dead letter queue enabled:</div>
+                    <div class="formLabel-labelCell" style="float:left; width: 240px;">Dead letter queue enabled:</div>
                     <div id="brokerAttribute.queue.deadLetterQueueEnabled" style="float:left;"></div>
                 </div>
                 <div id="brokerAttribute.queue.flowControlSizeBytes.container" style="clear:both">
-                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue flow capacity:</div>
+                    <div class="formLabel-labelCell" style="float:left; width: 240px;">Flow control threshold:</div>
                     <div id="brokerAttribute.queue.flowControlSizeBytes" style="float:left;"></div> bytes
                 </div>
                 <div id="brokerAttribute.queue.flowResumeSizeBytes.container" style="clear:both">
-                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Queue flow resume capacity:</div>
+                    <div class="formLabel-labelCell" style="float:left; width: 240px;">Flow resume threshold:</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: 'Global connection defaults',  open: true">
+            <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 class="formLabel-labelCell" style="float:left; width: 240px;">Maximum number of sessions:</div>
                     <div id="brokerAttribute.connection.sessionCountLimit" style="float:left;"></div>
                 </div>
                 <div id="brokerAttribute.connection.heartBeatDelay.container" style="clear:both">
-                    <div class="formLabel-labelCell" style="float:left; width: 250px;">Heart beat delay:</div>
+                    <div class="formLabel-labelCell" style="float:left; width: 240px;">Heart beat delay:</div>
                     <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 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 class="formLabel-labelCell" style="float:left; width: 240px;">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 class="formLabel-labelCell" style="float:left; width: 240px;">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 class="formLabel-labelCell" style="float:left; width: 240px;">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 class="formLabel-labelCell" style="float:left; width: 240px;">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 class="formLabel-labelCell" style="float:left; width: 240px;">Open store transaction warn timeout:</div>
                     <div id="brokerAttribute.virtualhost.storeTransactionOpenTimeoutWarn" style="float:left;"></div>ms
                 </div>
                 <div style="clear:both"></div>

Modified: qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AuthenticationProviderAdapter.java Thu Apr  4 12:25:41 2013
@@ -57,7 +57,6 @@ import org.apache.qpid.server.security.a
 import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
 import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.group.GroupPrincipalAccessor;
 import org.apache.qpid.server.security.SecurityManager;
 
 public abstract class AuthenticationProviderAdapter<T extends AuthenticationManager> extends AbstractAdapter implements AuthenticationProvider
@@ -252,7 +251,7 @@ public abstract class AuthenticationProv
     @Override
     public SubjectCreator getSubjectCreator()
     {
-        return new SubjectCreator(_authManager, new GroupPrincipalAccessor(_broker.getGroupProviders()));
+        return new SubjectCreator(_authManager, _broker.getGroupProviders());
     }
 
     @Override

Modified: qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java Thu Apr  4 12:25:41 2013
@@ -135,7 +135,7 @@ public class BrokerAdapter extends Abstr
     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";
+    private static final String DEFAULT_GROUP_PROVIDER_NAME = "defaultGroupProvider";
     private static final String DEFAULT_PEER_STORE_NAME = "defaultPeerStore";
 
     private static final String DUMMY_PASSWORD_MASK = "********";
@@ -238,13 +238,13 @@ public class BrokerAdapter extends Abstr
         {
             GroupManager groupManager = new FileGroupManager(groupFile);
             UUID groupProviderId = UUIDGenerator.generateBrokerChildUUID(GroupProvider.class.getSimpleName(),
-                    DEFAULT_GROUP_PROFIDER_NAME);
+                    DEFAULT_GROUP_PROVIDER_NAME);
             GroupProviderAdapter groupProviderAdapter = new GroupProviderAdapter(groupProviderId, groupManager, this);
-            _groupProviders.put(DEFAULT_GROUP_PROFIDER_NAME, groupProviderAdapter);
+            _groupProviders.put(DEFAULT_GROUP_PROVIDER_NAME, groupProviderAdapter);
         }
         else
         {
-            _groupProviders.remove(DEFAULT_GROUP_PROFIDER_NAME);
+            _groupProviders.remove(DEFAULT_GROUP_PROVIDER_NAME);
         }
     }
 
@@ -1097,12 +1097,6 @@ public class BrokerAdapter extends Abstr
                 }
             }
         }
-
-        // the calls below are not thread safe but they should be fine in a management mode
-        // as there will be no user connected
-        // The new keystore/trustore/peerstore will be only used with new ports
-        // At the moment we cannot restart ports with new keystore/trustore/peerstore
-
         if (keyStoreChanged)
         {
             createKeyStore();
@@ -1155,16 +1149,20 @@ public class BrokerAdapter extends Abstr
             }
         }
         Long queueFlowControlSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_SIZE_BYTES);
-        if (queueFlowControlSize != null && queueFlowControlSize > 0)
+        Long queueFlowControlResumeSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
+        if (queueFlowControlSize != null || queueFlowControlResumeSize != null )
         {
-            Long queueFlowControlResumeSize = (Long) convertedAttributes.get(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
+            if (queueFlowControlSize == null)
+            {
+                queueFlowControlSize = (Long)getAttribute(QUEUE_FLOW_CONTROL_SIZE_BYTES);
+            }
             if (queueFlowControlResumeSize == null)
             {
-                throw new IllegalConfigurationException("Flow control resume size attribute is not specified with flow control size attribute");
+                queueFlowControlResumeSize = (Long)getAttribute(QUEUE_FLOW_CONTROL_RESUME_SIZE_BYTES);
             }
-            if (queueFlowControlResumeSize >= queueFlowControlSize)
+            if (queueFlowControlResumeSize > queueFlowControlSize)
             {
-                throw new IllegalConfigurationException("Flow control resume size should be less then flow control size");
+                throw new IllegalConfigurationException("Flow resume size can't be greater than flow control size");
             }
         }
         for (String attributeName : POSITIVE_NUMERIC_ATTRIBUTES)

Modified: qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/GroupProviderAdapter.java Thu Apr  4 12:25:41 2013
@@ -538,8 +538,6 @@ public class GroupProviderAdapter extend
             return true;
         }
         // TODO: DELETE state is ignored for now
-        // in case if we need to delete group provider, then we need AuthenticationProvider to be a change listener of it
-        // in order to remove deleted group provider from its group provider list
         return false;
     }
 

Modified: qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java Thu Apr  4 12:25:41 2013
@@ -73,11 +73,6 @@ public class PortAdapter extends Abstrac
     private AuthenticationProvider _authenticationProvider;
     private AtomicReference<State> _state;
 
-    /*
-     * TODO register PortAceptor as a listener. For supporting multiple
-     * protocols on the same port we need to introduce a special entity like
-     * PortAceptor which will be responsible for port binding/unbinding
-     */
     public PortAdapter(UUID id, Broker broker, Map<String, Object> attributes, Map<String, Object> defaults, TaskExecutor taskExecutor)
     {
         super(id, defaults, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), taskExecutor);

Modified: qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/main/java/org/apache/qpid/server/security/SubjectCreator.java Thu Apr  4 12:25:41 2013
@@ -21,17 +21,21 @@
 package org.apache.qpid.server.security;
 
 import java.security.Principal;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
 
 import javax.security.auth.Subject;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 
+import org.apache.qpid.server.model.GroupProvider;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
 import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.group.GroupPrincipalAccessor;
 
 /**
  * Creates a {@link Subject} formed by the {@link Principal}'s returned from:
@@ -48,12 +52,12 @@ import org.apache.qpid.server.security.g
 public class SubjectCreator
 {
     private AuthenticationManager _authenticationManager;
-    private GroupPrincipalAccessor _groupAccessor;
+    private Collection<GroupProvider> _groupProviders;
 
-    public SubjectCreator(AuthenticationManager authenticationManager, GroupPrincipalAccessor groupAccessor)
+    public SubjectCreator(AuthenticationManager authenticationManager, Collection<GroupProvider> groupProviders)
     {
         _authenticationManager = authenticationManager;
-        _groupAccessor = groupAccessor;
+        _groupProviders = groupProviders;
     }
 
    /**
@@ -112,7 +116,7 @@ public class SubjectCreator
             final Subject authenticationSubject = new Subject();
 
             authenticationSubject.getPrincipals().addAll(authenticationResult.getPrincipals());
-            authenticationSubject.getPrincipals().addAll(_groupAccessor.getGroupPrincipals(username));
+            authenticationSubject.getPrincipals().addAll(getGroupPrincipals(username));
 
             authenticationSubject.setReadOnly();
 
@@ -129,9 +133,24 @@ public class SubjectCreator
         Subject authenticationSubject = new Subject();
 
         authenticationSubject.getPrincipals().add(new AuthenticatedPrincipal(username));
-        authenticationSubject.getPrincipals().addAll(_groupAccessor.getGroupPrincipals(username));
+        authenticationSubject.getPrincipals().addAll(getGroupPrincipals(username));
         authenticationSubject.setReadOnly();
 
         return authenticationSubject;
     }
+
+    public Set<Principal> getGroupPrincipals(String username)
+    {
+        Set<Principal> principals = new HashSet<Principal>();
+        for (GroupProvider groupProvider : _groupProviders)
+        {
+            Set<Principal> groups = groupProvider.getGroupPrincipalsForUser(username);
+            if (groups != null)
+            {
+                principals.addAll(groups);
+            }
+        }
+
+        return Collections.unmodifiableSet(principals);
+    }
 }

Modified: qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java?rev=1464498&r1=1464497&r2=1464498&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java (original)
+++ qpid/branches/0.22/qpid/java/broker/src/test/java/org/apache/qpid/server/security/SubjectCreatorTest.java Thu Apr  4 12:25:41 2013
@@ -23,19 +23,21 @@ import static org.mockito.Mockito.when;
 
 import java.security.Principal;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashSet;
+import java.util.Set;
 
 import javax.security.auth.Subject;
 import javax.security.sasl.SaslServer;
 
 import junit.framework.TestCase;
 
+import org.apache.qpid.server.model.GroupProvider;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.server.security.auth.AuthenticationResult.AuthenticationStatus;
 import org.apache.qpid.server.security.auth.SubjectAuthenticationResult;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.group.GroupPrincipalAccessor;
 
 public class SubjectCreatorTest extends TestCase
 {
@@ -43,13 +45,15 @@ public class SubjectCreatorTest extends 
     private static final String PASSWORD = "password";
 
     private AuthenticationManager _authenticationManager = mock(AuthenticationManager.class);
-    private GroupPrincipalAccessor _groupPrincipalAccessor = mock(GroupPrincipalAccessor.class);
-    private SubjectCreator _subjectCreator = new SubjectCreator(_authenticationManager, _groupPrincipalAccessor);
+
+    private GroupProvider _groupManager1 = mock(GroupProvider.class);
+    private GroupProvider _groupManager2 = mock(GroupProvider.class);
 
     private Principal _userPrincipal = mock(Principal.class);
     private Principal _group1 = mock(Principal.class);
     private Principal _group2 = mock(Principal.class);
 
+    private SubjectCreator _subjectCreator;
     private AuthenticationResult _authenticationResult;
     private SaslServer _testSaslServer = mock(SaslServer.class);
     private byte[] _saslResponseBytes = PASSWORD.getBytes();
@@ -57,11 +61,12 @@ public class SubjectCreatorTest extends 
     @Override
     public void setUp()
     {
+        when(_groupManager1.getGroupPrincipalsForUser(USERNAME)).thenReturn(Collections.singleton(_group1));
+        when(_groupManager2.getGroupPrincipalsForUser(USERNAME)).thenReturn(Collections.singleton(_group2));
+
+        _subjectCreator = new SubjectCreator(_authenticationManager, new HashSet<GroupProvider>(Arrays.asList(_groupManager1, _groupManager2)));
         _authenticationResult = new AuthenticationResult(_userPrincipal);
         when(_authenticationManager.authenticate(USERNAME, PASSWORD)).thenReturn(_authenticationResult);
-
-        when(_groupPrincipalAccessor.getGroupPrincipals(USERNAME))
-            .thenReturn(new HashSet<Principal>(Arrays.asList(_group1, _group2)));
     }
 
     public void testAuthenticateUsernameAndPasswordReturnsSubjectWithUserAndGroupPrincipals()
@@ -135,4 +140,30 @@ public class SubjectCreatorTest extends 
         assertSame(expectedStatus, subjectAuthenticationResult.getStatus());
         assertNull(subjectAuthenticationResult.getSubject());
     }
+
+    public void testGetGroupPrincipals()
+    {
+        getAndAssertGroupPrincipals(_group1, _group2);
+    }
+
+    public void testGetGroupPrincipalsWhenAGroupManagerReturnsNull()
+    {
+        when(_groupManager1.getGroupPrincipalsForUser(USERNAME)).thenReturn(null);
+
+        getAndAssertGroupPrincipals(_group2);
+    }
+
+    public void testGetGroupPrincipalsWhenAGroupManagerReturnsEmptySet()
+    {
+        when(_groupManager2.getGroupPrincipalsForUser(USERNAME)).thenReturn(new HashSet<Principal>());
+
+        getAndAssertGroupPrincipals(_group1);
+    }
+
+    private void getAndAssertGroupPrincipals(Principal... expectedGroups)
+    {
+        Set<Principal> actualGroupPrincipals = _subjectCreator.getGroupPrincipals(USERNAME);
+        Set<Principal> expectedGroupPrincipals = new HashSet<Principal>(Arrays.asList(expectedGroups));
+        assertEquals(expectedGroupPrincipals, actualGroupPrincipals);
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org