qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1471141 [3/11] - in /qpid/branches/QPID-4659/qpid/java: ./ amqp-1-0-client-jms/ amqp-1-0-client/ amqp-1-0-common/ amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ broker-plugins/access-control/src/main/java/org/apache/qpid...
Date Tue, 23 Apr 2013 20:54:24 GMT
Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js Tue Apr 23 20:54:19 2013
@@ -31,6 +31,9 @@ define(["dojo/_base/xhr",
         "qpid/management/addAuthenticationProvider",
         "qpid/management/addVirtualHost",
         "qpid/management/addPort",
+        "qpid/management/addKeystore",
+        "qpid/management/addGroupProvider",
+        "qpid/management/addAccessControlProvider",
         "dojox/grid/enhanced/plugins/Pagination",
         "dojox/grid/enhanced/plugins/IndirectSelection",
         "dijit/layout/AccordionContainer",
@@ -41,7 +44,7 @@ define(["dojo/_base/xhr",
         "dijit/form/CheckBox",
         "dojo/store/Memory",
         "dojo/domReady!"],
-       function (xhr, parser, query, connect, properties, updater, util, UpdatableStore, EnhancedGrid, registry, addAuthenticationProvider, addVirtualHost, addPort) {
+       function (xhr, parser, query, connect, properties, updater, util, UpdatableStore, EnhancedGrid, registry, addAuthenticationProvider, addVirtualHost, addPort, addKeystore, addGroupProvider, addAccessControlProvider) {
 
            function Broker(name, parent, controller) {
                this.name = name;
@@ -57,29 +60,10 @@ define(["dojo/_base/xhr",
                         return new dijit.form.ValidationTextBox({
                           required: true,
                           value: brokerData.name,
-                          disabled: true,
                           label: "Name*:",
                           name: "name"})
                     }
                }, {
-                      name: "defaultAuthenticationProvider",
-                      createWidget: function(brokerData) {
-                        var providers = brokerData.authenticationproviders;
-                        var data = [];
-                        if (providers) {
-                           for (var i=0; i< providers.length; i++) {
-                               data.push({id: providers[i].name, name: providers[i].name});
-                           }
-                        }
-                        var providersStore = new dojo.store.Memory({ data: data });
-                        return new dijit.form.FilteringSelect({
-                           required: true,
-                           store: providersStore,
-                           value: brokerData.defaultAuthenticationProvider,
-                           label: "Default Authentication Provider*:",
-                           name: "defaultAuthenticationProvider"})
-                      }
-               }, {
                        name: "defaultVirtualHost",
                        createWidget: function(brokerData) {
                          var hosts = brokerData.virtualhosts;
@@ -97,98 +81,6 @@ define(["dojo/_base/xhr",
                            name: "defaultVirtualHost"})
                        }
                }, {
-                       name: "aclFile",
-                       createWidget: function(brokerData) {
-                          return new dijit.form.ValidationTextBox({
-                            required: false,
-                            value: brokerData.aclFile,
-                            label: "ACL file location:",
-                            name: "aclFile"})
-                       }
-               }, {
-                       name: "groupFile",
-                       createWidget: function(brokerData)
-                       {
-                           return new dijit.form.ValidationTextBox({
-                             required: false,
-                             value: brokerData.groupFile,
-                             label: "Group file location:",
-                             name: "groupFile"});
-                       }
-               }, {
-                       name: "keyStorePath",
-                       createWidget: function(brokerData) {
-                           return new dijit.form.ValidationTextBox({
-                             required: false,
-                             value: brokerData.keyStorePath,
-                             label: "Path to keystore:",
-                             name: "keyStorePath"});
-                       }
-               }, {
-                       name: "keyStorePassword",
-                       requiredFor: "keyStorePath",
-                       createWidget: function(brokerData) {
-                           return new dijit.form.ValidationTextBox({
-                             required: false,
-                             label: "Keystore password:",
-                             invalidMessage: "Missed keystore password",
-                             name: "keyStorePassword",
-                             placeholder: brokerData["keyStorePassword"] ? brokerData["keyStorePassword"] : ""
-                             });
-                       }
-               }, {
-                       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)
-                       {
-                         return new dijit.form.ValidationTextBox({
-                             required: false,
-                             value: brokerData.trustStorePath,
-                             label: "Path to truststore:",
-                             name: "trustStorePath"});
-                       }
-               }, {
-                       name: "trustStorePassword",
-                       requiredFor: "trustStorePath",
-                       createWidget: function(brokerData) {
-                         return new dijit.form.ValidationTextBox({
-                           required: false,
-                           label: "Truststore password:",
-                           invalidMessage: "Missed trustore password",
-                           name: "trustStorePassword",
-                           placeholder: brokerData["trustStorePassword"] ? brokerData["trustStorePassword"] : ""
-                           });
-                       }
-               }, {
-                       name: "peerStorePath",
-                       createWidget: function(brokerData) {
-                         return new dijit.form.ValidationTextBox({
-                           required: false,
-                           value: brokerData.peerStorePath,
-                           label: "Path to peerstore:",
-                           name: "peerStorePath"});
-                       }
-               }, {
-                       name: "peerStorePassword",
-                       requiredFor: "peerStorePath",
-                       createWidget: function(brokerData) {
-                         return new dijit.form.ValidationTextBox({
-                           required: false,
-                           label: "Peerstore password:",
-                           invalidMessage: "Missed peerstore password",
-                           name: "peerStorePassword",
-                           placeholder: brokerData["peerStorePassword"] ? brokerData["peerStorePassword"] : ""
-                         });
-                       }
-               }, {
                        name: "statisticsReportingPeriod",
                        createWidget: function(brokerData) {
                          return new dijit.form.ValidationTextBox({
@@ -305,7 +197,7 @@ define(["dojo/_base/xhr",
                            checked: brokerData["queue.deadLetterQueueEnabled"],
                            value: "true",
                            label: "Dead letter queue enabled:",
-                           name: "queue.deadLetterQueueEnabled",
+                           name: "queue.deadLetterQueueEnabled"
                          });
                        }
                }, {
@@ -319,7 +211,7 @@ define(["dojo/_base/xhr",
                            value: brokerData["queue.flowControlSizeBytes"],
                            placeholder: "Size in bytes",
                            label: "Flow control threshold (bytes):",
-                           name: "queue.flowControlSizeBytes",
+                           name: "queue.flowControlSizeBytes"
                          });
                        }
                }, {
@@ -333,7 +225,7 @@ define(["dojo/_base/xhr",
                            value: brokerData["queue.flowResumeSizeBytes"],
                            placeholder: "Size in bytes",
                            label: "Flow resume threshold (bytes):",
-                           name: "queue.flowResumeSizeBytes",
+                           name: "queue.flowResumeSizeBytes"
                          });
                        }
                }, {
@@ -488,7 +380,10 @@ define(["dojo/_base/xhr",
                             );
 
                             var addPortButton = query(".addPort", contentPane.containerNode)[0];
-                            connect.connect(registry.byNode(addPortButton), "onClick", function(evt){ addPort.show(null, that.brokerUpdater.brokerData.authenticationproviders); });
+                            connect.connect(registry.byNode(addPortButton), "onClick", function(evt){
+                              addPort.show(null, that.brokerUpdater.brokerData.authenticationproviders,
+                                  that.brokerUpdater.brokerData.keystores, that.brokerUpdater.brokerData.truststores);
+                            });
 
                             var deletePort = query(".deletePort", contentPane.containerNode)[0];
                             connect.connect(registry.byNode(deletePort), "onClick",
@@ -512,6 +407,79 @@ define(["dojo/_base/xhr",
                                 }
                             );
 
+                            var addKeystoreButton = query(".addKeystore", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(addKeystoreButton), "onClick",
+                                function(evt){ addKeystore.showKeystoreDialog() });
+
+                            var deleteKeystore = query(".deleteKeystore", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(deleteKeystore), "onClick",
+                                    function(evt){
+                                        util.deleteGridSelections(
+                                                that.brokerUpdater,
+                                                that.brokerUpdater.keyStoresGrid.grid,
+                                                "rest/keystore",
+                                                "Are you sure you want to delete key store");
+                                }
+                            );
+
+                            var addTruststoreButton = query(".addTruststore", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(addTruststoreButton), "onClick",
+                                function(evt){ addKeystore.showTruststoreDialog() });
+
+                            var deleteTruststore = query(".deleteTruststore", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(deleteTruststore), "onClick",
+                                    function(evt){
+                                        util.deleteGridSelections(
+                                                that.brokerUpdater,
+                                                that.brokerUpdater.trustStoresGrid.grid,
+                                                "rest/truststore",
+                                                "Are you sure you want to delete trust store");
+                                }
+                            );
+
+                            var addGroupProviderButton = query(".addGroupProvider", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(addGroupProviderButton), "onClick",
+                                function(evt){addGroupProvider.show();});
+
+                            var deleteGroupProvider = query(".deleteGroupProvider", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(deleteGroupProvider), "onClick",
+                                    function(evt){
+                                        var warning = "";
+                                        var data = that.brokerUpdater.groupProvidersGrid.grid.selection.getSelected();
+                                        if(data.length && data.length > 0)
+                                        {
+                                          for(var i = 0; i<data.length; i++)
+                                          {
+                                              if (data[i].type.indexOf("File") != -1)
+                                              {
+                                                warning = "NOTE: provider deletion will also remove the group file on disk.\n\n"
+                                                break;
+                                              }
+                                          }
+                                        }
+
+                                        util.deleteGridSelections(
+                                                that.brokerUpdater,
+                                                that.brokerUpdater.groupProvidersGrid.grid,
+                                                "rest/groupprovider",
+                                                warning + "Are you sure you want to delete group provider");
+                                }
+                            );
+
+                            var addAccessControlButton = query(".addAccessControlProvider", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(addAccessControlButton), "onClick",
+                                function(evt){addAccessControlProvider.show();});
+
+                            var deleteAccessControlProviderButton = query(".deleteAccessControlProvider", contentPane.containerNode)[0];
+                            connect.connect(registry.byNode(deleteAccessControlProviderButton), "onClick",
+                                    function(evt){
+                                        util.deleteGridSelections(
+                                                that.brokerUpdater,
+                                                that.brokerUpdater.accessControlProvidersGrid.grid,
+                                                "rest/accesscontrolprovider",
+                                                "Are you sure you want to delete access control provider");
+                                }
+                            );
                         }});
            };
 
@@ -524,6 +492,7 @@ define(["dojo/_base/xhr",
                this.controller = controller;
                this.query = "rest/broker";
                this.attributes = attributes;
+               this.accessControlProvidersWarn = query(".broker-access-control-providers-warning", node)[0]
                var that = this;
 
                xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
@@ -570,7 +539,7 @@ define(["dojo/_base/xhr",
                                 new UpdatableStore(that.brokerData.ports, query(".broker-ports")[0],
                                                 [   { name: "Name", field: "name", width: "150px"},
                                                     { name: "State", field: "state", width: "60px"},
-                                                    { name: "Authentication", field: "authenticationProvider", width: "100px"},
+                                                    { name: "Auth Provider", field: "authenticationProvider", width: "100px"},
                                                     { name: "Address",    field: "bindingAddress",      width: "70px"},
                                                     { name: "Port", field: "port", width: "50px"},
                                                     { name: "Transports", field: "transports", width: "100px"},
@@ -581,7 +550,7 @@ define(["dojo/_base/xhr",
                                                             var idx = evt.rowIndex,
                                                                 theItem = this.getItem(idx);
                                                             var name = obj.dataStore.getValue(theItem,"name");
-                                                            addPort.show(name, that.brokerData.authenticationproviders);
+                                                            that.controller.show("port", name, brokerObj);
                                                         });
                                                 }, gridProperties, EnhancedGrid);
 
@@ -615,6 +584,71 @@ define(["dojo/_base/xhr",
                                                          });
                                                  }, gridProperties, EnhancedGrid);
 
+                             that.keyStoresGrid =
+                               new UpdatableStore(that.brokerData.keystores, query(".broker-key-stores")[0],
+                                               [ { name: "Name",    field: "name",      width: "20%"},
+                                                 { name: "Path", field: "path", width: "40%"},
+                                                 { name: "Type", field: "type", width: "5%"},
+                                                 { name: "Key Manager Algorithm", field: "keyManagerFactoryAlgorithm", width: "20%"},
+                                                 { name: "Alias", field: "certificateAlias", width: "15%"}
+                                               ], function(obj) {
+                                                       connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                       function(evt){
+                                                           var idx = evt.rowIndex,
+                                                               theItem = this.getItem(idx);
+                                                           var name = obj.dataStore.getValue(theItem,"name");
+                                                           that.controller.show("keystore", name, brokerObj);
+                                                       });
+                                               }, gridProperties, EnhancedGrid);
+
+                             that.trustStoresGrid =
+                               new UpdatableStore(that.brokerData.truststores, query(".broker-trust-stores")[0],
+                                               [ { name: "Name",    field: "name",      width: "20%"},
+                                                 { name: "Path", field: "path", width: "40%"},
+                                                 { name: "Type", field: "type", width: "5%"},
+                                                 { name: "Trust Manager Algorithm", field: "trustManagerFactoryAlgorithm", width: "25%"},
+                                                 { name: "Peers only", field: "peersOnly", width: "10%",
+                                                   formatter: function(val){
+                                                     return "<input type='radio' disabled='disabled' "+(val ? "checked='checked'": "")+" />";
+                                                   }
+                                                 }
+                                               ], function(obj) {
+                                                       connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                       function(evt){
+                                                           var idx = evt.rowIndex,
+                                                               theItem = this.getItem(idx);
+                                                           var name = obj.dataStore.getValue(theItem,"name");
+                                                           that.controller.show("truststore", name, brokerObj);
+                                                       });
+                                               }, gridProperties, EnhancedGrid);
+                             that.groupProvidersGrid =
+                               new UpdatableStore(that.brokerData.groupproviders, query(".broker-group-providers")[0],
+                                               [ { name: "Name",    field: "name",      width: "50%"},
+                                                 { name: "Type", field: "type", width: "50%"}
+                                               ], function(obj) {
+                                                       connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                       function(evt){
+                                                           var idx = evt.rowIndex,
+                                                               theItem = this.getItem(idx);
+                                                           var name = obj.dataStore.getValue(theItem,"name");
+                                                           that.controller.show("groupprovider", name, brokerObj);
+                                                       });
+                                               }, gridProperties, EnhancedGrid);
+                             var aclData = that.brokerData.accesscontrolproviders ? that.brokerData.accesscontrolproviders :[];
+                             that.accessControlProvidersGrid =
+                               new UpdatableStore(aclData, query(".broker-access-control-providers")[0],
+                                               [ { name: "Name",    field: "name",      width: "60%"},
+                                                 { name: "Type", field: "type", width: "40%"}
+                                               ], function(obj) {
+                                                       connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                                       function(evt){
+                                                           var idx = evt.rowIndex,
+                                                               theItem = this.getItem(idx);
+                                                           var name = obj.dataStore.getValue(theItem,"name");
+                                                           that.controller.show("accesscontrolprovider", name, brokerObj);
+                                                       });
+                                               }, gridProperties, EnhancedGrid);
+                             that.displayACLWarnMessage(aclData);
                          });
 
                xhr.get({url: "rest/logrecords", sync: properties.useSyncGet, handleAs: "json"})
@@ -659,6 +693,7 @@ define(["dojo/_base/xhr",
            {
                this.showReadOnlyAttributes();
                var brokerData = this.brokerData;
+               window.document.title = "Qpid: " + brokerData.name + " Management";
                for(var i in this.attributes)
                {
                  var propertyName = this.attributes[i].name;
@@ -682,6 +717,43 @@ define(["dojo/_base/xhr",
                }
            };
 
+           BrokerUpdater.prototype.displayACLWarnMessage = function(aclProviderData)
+           {
+             var message = "";
+             if (aclProviderData.length > 1)
+             {
+               var aclProviders = {};
+               var theSameTypeFound = false;
+               for(var d=0; d<aclProviderData.length; d++)
+               {
+                 var acl = aclProviderData[d];
+                 var aclType = acl.type;
+                 if (aclProviders[aclType])
+                 {
+                   aclProviders[aclType].push(acl.name);
+                   theSameTypeFound = true;
+                 }
+                 else
+                 {
+                   aclProviders[aclType] = [acl.name];
+                 }
+               }
+
+               if (theSameTypeFound)
+               {
+                 message = "Only one instance of a given type will be used. Please remove an instance of type(s):";
+                 for(var aclType in aclProviders)
+                 {
+                     if(aclProviders[aclType].length>1)
+                     {
+                       message +=  " " + aclType;
+                     }
+                 }
+               }
+             }
+             this.accessControlProvidersWarn.innerHTML = message;
+           }
+
            BrokerUpdater.prototype.update = function()
            {
 
@@ -699,6 +771,25 @@ define(["dojo/_base/xhr",
                                                                                        that.portsGrid.update(that.brokerData.ports);
 
                                                                                        that.authenticationProvidersGrid.update(that.brokerData.authenticationproviders);
+
+                                                                                       if (that.keyStoresGrid)
+                                                                                       {
+                                                                                         that.keyStoresGrid.update(that.brokerData.keystores);
+                                                                                       }
+                                                                                       if (that.trustStoresGrid)
+                                                                                       {
+                                                                                         that.trustStoresGrid.update(that.brokerData.truststores);
+                                                                                       }
+                                                                                       if (that.groupProvidersGrid)
+                                                                                       {
+                                                                                         that.groupProvidersGrid.update(that.brokerData.groupproviders);
+                                                                                       }
+                                                                                       if (that.accessControlProvidersGrid)
+                                                                                       {
+                                                                                         var data = that.brokerData.accesscontrolproviders ? that.brokerData.accesscontrolproviders :[];
+                                                                                         that.accessControlProvidersGrid.update(data);
+                                                                                         that.displayACLWarnMessage(data);
+                                                                                       }
                                                                                    });
 
 
@@ -718,7 +809,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.modelVersion").innerHTML = brokerData.managementVersion;
+               dojo.byId("brokerAttribute.modelVersion").innerHTML = brokerData.modelVersion;
                dojo.byId("brokerAttribute.storeType").innerHTML = brokerData.storeType;
                dojo.byId("brokerAttribute.storeVersion").innerHTML = brokerData.storeVersion;
                dojo.byId("brokerAttribute.storePath").innerHTML = brokerData.storePath;

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/GroupProvider.js Tue Apr 23 20:54:19 2013
@@ -27,10 +27,12 @@ define(["dojo/_base/xhr",
         "qpid/common/util",
         "qpid/common/UpdatableStore",
         "dojox/grid/EnhancedGrid",
+        "dijit/registry",
+        "dojo/_base/event",
         "dojox/grid/enhanced/plugins/Pagination",
         "dojox/grid/enhanced/plugins/IndirectSelection",
         "dojo/domReady!"],
-       function (xhr, parser, query, connect, properties, updater, util, UpdatableStore, EnhancedGrid) {
+       function (xhr, parser, query, connect, properties, updater, util, UpdatableStore, EnhancedGrid, registry, event) {
 
            function GroupProvider(name, parent, controller) {
                this.name = name;
@@ -43,7 +45,7 @@ define(["dojo/_base/xhr",
            }
 
            GroupProvider.prototype.getTitle = function() {
-               return "GroupProvider";
+               return "GroupProvider: " + this.name ;
            };
 
            GroupProvider.prototype.open = function(contentPane) {
@@ -61,6 +63,13 @@ define(["dojo/_base/xhr",
 
                             that.groupProviderAdapter.update();
 
+                            var deleteButton = query(".deleteGroupProviderButton", contentPane.containerNode)[0];
+                            var deleteWidget = registry.byNode(deleteButton);
+                            connect.connect(deleteWidget, "onClick",
+                                            function(evt){
+                                                event.stop(evt);
+                                                that.deleteGroupProvider();
+                                            });
                         }});
            };
 
@@ -68,12 +77,37 @@ define(["dojo/_base/xhr",
                updater.remove( this.groupProviderAdapter );
            };
 
+           GroupProvider.prototype.deleteGroupProvider = function() {
+             var warnMessage = "";
+             if (this.groupProviderAdapter.groupProviderData && this.groupProviderAdapter.groupProviderData.type.indexOf("File") != -1)
+             {
+               warnMessage = "NOTE: provider deletion will also remove the group file on disk.\n\n";
+             }
+             if(confirm(warnMessage + "Are you sure you want to delete group provider '" + this.name + "'?")) {
+                 var query = "rest/groupprovider/" +encodeURIComponent(this.name);
+                 this.success = true
+                 var that = this;
+                 xhr.del({url: query, sync: true, handleAs: "json"}).then(
+                     function(data) {
+                         that.close();
+                         that.contentPane.onClose()
+                         that.controller.tabContainer.removeChild(that.contentPane);
+                         that.contentPane.destroyRecursive();
+                     },
+                     function(error) {that.success = false; that.failureReason = error;});
+                 if(!this.success ) {
+                     alert("Error:" + this.failureReason);
+                 }
+             }
+         };
+
            function GroupProviderUpdater(node, groupProviderObj, controller)
            {
                this.controller = controller;
                this.name = query(".name", node)[0];
+               this.type = query(".type", node)[0];
                this.query = "rest/groupprovider/"+encodeURIComponent(groupProviderObj.name);
-
+               this.typeUI ={"GroupFile": "FileGroupManager"};
                var that = this;
 
                xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
@@ -85,9 +119,10 @@ define(["dojo/_base/xhr",
 
                              that.updateHeader();
 
-                             require(["qpid/management/groupprovider/"+that.groupProviderData.type],
+                             var ui = that.typeUI[that.groupProviderData.type];
+                             require(["qpid/management/groupprovider/"+ ui],
                                  function(SpecificProvider) {
-                                 that.details = new SpecificProvider(node, groupProviderObj, controller);
+                                 that.details = new SpecificProvider(query(".providerDetails", node)[0], groupProviderObj, controller);
                                  that.details.update();
                              });
 
@@ -98,6 +133,7 @@ define(["dojo/_base/xhr",
            GroupProviderUpdater.prototype.updateHeader = function()
            {
                this.name.innerHTML = this.groupProviderData[ "name" ];
+               this.type.innerHTML = this.groupProviderData[ "type" ];
            };
 
            GroupProviderUpdater.prototype.update = function()

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js Tue Apr 23 20:54:19 2013
@@ -207,7 +207,7 @@ define(["dojo/_base/xhr",
                                var layout = new dojox.layout.TableContainer( {
                                    id: providerType + "FieldSet",
                                    cols: 1,
-                                   "labelWidth": "300",
+                                   "labelWidth": "200",
                                    showLabels: true,
                                    orientation: "horiz"
                                });

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js Tue Apr 23 20:54:19 2013
@@ -28,6 +28,7 @@ define(["dojo/_base/xhr",
         "dojo/_base/event",
         'dojo/_base/json',
         "dojo/store/Memory",
+        "dojo/data/ObjectStore",
         "dijit/form/FilteringSelect",
         "dojo/dom-style",
         "dojo/_base/lang",
@@ -50,9 +51,10 @@ define(["dojo/_base/xhr",
         "dijit/form/Select",
         "dijit/form/NumberSpinner",
         /* basic dojox classes */
-        "dojox/form/BusyButton",
+        "dojox/grid/EnhancedGrid",
+        "dojox/grid/enhanced/plugins/IndirectSelection",
         "dojo/domReady!"],
-    function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, domStyle, lang) {
+    function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, ObjectStore, FilteringSelect, domStyle, lang) {
 
         var addPort = {};
 
@@ -110,36 +112,79 @@ define(["dojo/_base/xhr",
                 var type = dijit.byId("formAddPort.type").value;
                 if (type == "AMQP")
                 {
+                    var transportWidget = registry.byId("formAddPort.transports");
                     var needClientAuth = dijit.byId("formAddPort.needClientAuth");
                     var wantClientAuth = dijit.byId("formAddPort.wantClientAuth");
-                    newPort.needClientAuth = needClientAuth.disabled ? false : needClientAuth.checked;
-                    newPort.wantClientAuth = wantClientAuth.disabled ? false : wantClientAuth.checked
+                    var trustStoreWidget = dijit.byId("formAddPort.trustStores");
+
+                    var initialTransport = transportWidget.initialValue;
+                    var currentTransport = transportWidget.value;
+                    if (currentTransport == "SSL")
+                    {
+                      newPort.needClientAuth = needClientAuth.checked;
+                      newPort.wantClientAuth = wantClientAuth.checked
+
+                      var items = trustStoreWidget.selection.getSelected();
+                      var trustStores = [];
+                      if(items.length > 0){
+                        for(var i in items)
+                        {
+                          var item = items[i];
+                          trustStores.push(trustStoreWidget.store.getValue(item, "name"));
+                        }
+                        newPort.trustStores = trustStores;
+                      }
+                      else if (trustStoreWidget.initialValue && trustStoreWidget.initialValue.length > 0)
+                      {
+                        newPort.trustStores = null;
+                      }
+                    }
+                    else if (initialTransport && currentTransport != initialTransport)
+                    {
+                      newPort.needClientAuth = false;
+                      newPort.wantClientAuth = false;
+                      newPort.trustStores = null;
+                    }
                 }
+
                 return newPort;
             };
 
-            var toggleCertificateWidgets = function toggleCertificateWidgets(protocolType, transportType)
+            var toggleSslWidgets = function toggleSslWidgets(protocolType, transportType)
             {
-                var clientAuthPanel = registry.byId("formAddPort:fieldsClientAuth");
-                var display = clientAuthPanel.domNode.style.display;
+                var clientAuthPanel = dojo.byId("formAddPort:fieldsClientAuth");
+                var display = clientAuthPanel.style.display;
                 if (transportType == "SSL" && protocolType == "AMQP")
                 {
-                    clientAuthPanel.domNode.style.display = "block";
+                    clientAuthPanel.style.display = "block";
                     registry.byId("formAddPort.needClientAuth").set("disabled", false);
                     registry.byId("formAddPort.wantClientAuth").set("disabled", false);
                 }
                 else
                 {
-                    clientAuthPanel.domNode.style.display = "none";
+                    clientAuthPanel.style.display = "none";
                     registry.byId("formAddPort.needClientAuth").set("disabled", true);
                     registry.byId("formAddPort.wantClientAuth").set("disabled", true);
                 }
-                if (clientAuthPanel.domNode.style.display != display)
+
+                var transportSSLPanel = registry.byId("formAddPort:fieldsTransportSSL");
+                var transportSSLPanelDisplay = transportSSLPanel.domNode.style.display;
+                if (transportType == "SSL")
                 {
-                    clientAuthPanel.resize();
+                    transportSSLPanel.domNode.style.display = "block";
+                    registry.byId("formAddPort.keyStore").set("disabled", false);
+                }
+                else
+                {
+                    transportSSLPanel.domNode.style.display = "none";
+                    registry.byId("formAddPort.keyStore").set("disabled", true);
                 }
-            };
 
+                if (transportSSLPanel.domNode.style.display != transportSSLPanelDisplay && transportSSLPanel.domNode.style.display=="block")
+                {
+                    registry.byId("formAddPort.trustStores").resize();
+                }
+            };
 
         xhr.get({url: "addPort.html",
                  sync: true,
@@ -155,7 +200,7 @@ define(["dojo/_base/xhr",
 
                             registry.byId("formAddPort.transports").on("change", function(newValue){
                                 var protocolType = registry.byId("formAddPort.type").value;
-                                toggleCertificateWidgets(protocolType, newValue);
+                                toggleSslWidgets(protocolType, newValue);
                             });
 
                             registry.byId("formAddPort.type").on("change", function(newValue) {
@@ -166,8 +211,9 @@ define(["dojo/_base/xhr",
                                     registry.byId("formAddPort:fields" + option.value).domNode.style.display = "none";
                                 });
 
-                                registry.byId("formAddPort.needClientAuth").set("enabled", ("AMQP" == newValue));
-                                registry.byId("formAddPort.wantClientAuth").set("enabled", ("AMQP" == newValue));
+                                var isAMQP = ("AMQP" == newValue);
+                                registry.byId("formAddPort.needClientAuth").set("enabled", isAMQP);
+                                registry.byId("formAddPort.wantClientAuth").set("enabled", isAMQP);
 
                                 registry.byId("formAddPort:fields" + newValue).domNode.style.display = "block";
                                 var defaultsAMQPProtocols = registry.byId("formAddPort.protocolsDefault");
@@ -175,19 +221,95 @@ define(["dojo/_base/xhr",
                                 var protocolsWidget = registry.byId("formAddPort.protocols" + newValue);
                                 if (protocolsWidget)
                                 {
-                                    protocolsWidget.set("disabled", ("AMQP" == newValue && defaultsAMQPProtocols.checked));
+                                    protocolsWidget.set("disabled", (isAMQP && defaultsAMQPProtocols.checked));
+                                }
+
+                                var transportWidget = registry.byId("formAddPort.transports");
+                                var disableTransportWidget = false;
+                                var toggleSsl = true;
+                                var isRMI = (newValue == "JMX" && registry.byId("formAddPort.protocolsJMX").value == "RMI");
+                                if (isRMI)
+                                {
+                                    if  (transportWidget.value != "TCP")
+                                    {
+                                      transportWidget.set("value", "TCP");
+
+                                      // changing of transport widget value will cause the call to toggleSslWidgets
+                                      toggleSsl = false;
+                                    }
+                                    disableTransportWidget = true;
+                                }
+                                else if (newValue == "HTTP" && registry.byId("formAddPort.protocolsHTTP").value == "HTTPS")
+                                {
+                                    if  (transportWidget.value != "SSL")
+                                    {
+                                      transportWidget.set("value", "SSL");
+
+                                      // changing of transport widget value will cause the call to toggleSslWidgets
+                                      toggleSsl = false;
+                                    }
+                                    disableTransportWidget = true;
+                                }
+                                if (toggleSsl)
+                                {
+                                  toggleSslWidgets(newValue, transportWidget.value);
                                 }
-                                var transport = registry.byId("formAddPort.transports").value;
-                                toggleCertificateWidgets(newValue, transport);
+                                transportWidget.set("disabled", disableTransportWidget);
+                                registry.byId("formAddPort.authenticationProvider").set("disabled", isRMI);
+                                registry.byId("formAddPort:fieldsAuthenticationProvider").domNode.style.display = isRMI? "none" : "block";
                             });
+
                             theForm = registry.byId("formAddPort");
 
+                            var containers = ["formAddPort:fields", "formAddPort:fieldsTransportSSL", "formAddPort:fieldsAMQP",
+                                              "formAddPort:fieldsJMX", "formAddPort:fieldsHTTP", "formAddPort:transport",
+                                              "formAddPort:fieldsClientAuthCheckboxes", "formAddPort:fieldsAuthenticationProvider"];
+                            var labelWidthValue = "200";
+                            for(var i = 0; i < containers.length; i++)
+                            {
+                                var containerId = containers[i];
+                                var fields = new dojox.layout.TableContainer( {
+                                    cols: 1,
+                                    labelWidth: labelWidthValue,
+                                    showLabels: true,
+                                    orientation: "horiz",
+                                    customClass: "formLabel"
+                                }, dom.byId(containerId));
+                                fields.startup();
+                            }
+
+                            registry.byId("formAddPort.protocolsJMX").on("change", function(newValue){
+                                var isRMI = newValue == "RMI";
+                                var transportWidget = registry.byId("formAddPort.transports");
+                                if (isRMI && transportWidget.value != "TCP")
+                                {
+                                    transportWidget.set("value", "TCP");
+                                }
+                                transportWidget.set("disabled", isRMI);
+                                registry.byId("formAddPort:fieldsAuthenticationProvider").domNode.style.display = isRMI? "none" : "block";
+                                registry.byId("formAddPort.authenticationProvider").set("disabled", isRMI);
+                            });
+
+                            registry.byId("formAddPort.protocolsHTTP").on("change", function(newValue){
+                                var isHTTPS = newValue == "HTTPS";
+                                var transportWidget = registry.byId("formAddPort.transports");
+                                if (isHTTPS && transportWidget.value != "SSL") {
+                                    transportWidget.set("value", "SSL");
+                                }
+                                transportWidget.set("disabled", isHTTPS);
+                            });
+
                             theForm.on("submit", function(e) {
 
                                 event.stop(e);
                                 if(theForm.validate()){
 
                                     var newPort = convertToPort(theForm.getValues());
+                                    if ((newPort.needClientAuth || newPort.wantClientAuth) && (!newPort.hasOwnProperty("trustStores") || newPort.trustStores.length==0))
+                                    {
+                                      alert("A trustore must be selected when requesting client certificates.");
+                                      return false;
+                                    }
                                     var that = this;
 
                                     xhr.put({url: "rest/port/"+encodeURIComponent(newPort.name), sync: true, handleAs: "json",
@@ -216,52 +338,8 @@ define(["dojo/_base/xhr",
                             });
                         }});
 
-        addPort.show = function(portName, providers) {
+        addPort.show = function(portName, providers, keystores, truststores) {
 
-            if (!addPort.fields)
-            {
-                var labelWidthValue = "300";
-                addPort.fields = new dojox.layout.TableContainer( {
-                    cols: 1,
-                    labelWidth: labelWidthValue,
-                    showLabels: true,
-                    orientation: "horiz",
-                    customClass: "formLabel"
-                }, dom.byId("formAddPort:fields"));
-                addPort.fields.startup();
-                addPort.fieldsClientAuth = new dojox.layout.TableContainer( {
-                    cols: 1,
-                    labelWidth: labelWidthValue,
-                    showLabels: true,
-                    orientation: "horiz",
-                    customClass: "formLabel"
-                }, dom.byId("formAddPort:fieldsClientAuth"));
-                addPort.fieldsClientAuth.startup();
-                addPort.fieldsAMQP = new dojox.layout.TableContainer( {
-                    cols: 1,
-                    labelWidth: labelWidthValue,
-                    showLabels: true,
-                    orientation: "horiz",
-                    customClass: "formLabel"
-                }, dom.byId("formAddPort:fieldsAMQP"));
-                addPort.fieldsAMQP.startup();
-                addPort.fieldsJMX = new dojox.layout.TableContainer( {
-                  cols: 1,
-                  labelWidth: labelWidthValue,
-                  showLabels: true,
-                  orientation: "horiz",
-                  customClass: "formLabel"
-                }, dom.byId("formAddPort:fieldsJMX"));
-                addPort.fieldsJMX.startup();
-                addPort.fieldsHTTP = new dojox.layout.TableContainer( {
-                  cols: 1,
-                  labelWidth: labelWidthValue,
-                  showLabels: true,
-                  orientation: "horiz",
-                  customClass: "formLabel"
-                }, dom.byId("formAddPort:fieldsHTTP"));
-                addPort.fieldsHTTP.startup();
-            }
             registry.byId("formAddPort").reset();
             dojo.byId("formAddPort.id").value = "";
 
@@ -278,6 +356,36 @@ define(["dojo/_base/xhr",
                 providerWidget.startup();
             }
 
+            var keystoreWidget = registry.byId("formAddPort.keyStore");
+            if (keystores)
+            {
+                var data = [];
+                for (var i=0; i< keystores.length; i++)
+                {
+                    data.push( {id: keystores[i].name, name: keystores[i].name} );
+                }
+                var keystoresStore = new Memory({ data: data });
+                keystoreWidget.set("store", keystoresStore);
+                keystoreWidget.startup();
+            }
+
+            var truststoreWidget = registry.byId("formAddPort.trustStores");
+            if (truststores)
+            {
+                var layout = [[{name: "Name", field: "name", width: "80%"},
+                               {name: "Peers only", field: "peersOnly", width: "20%",
+                                 formatter: function(val){
+                                   return "<input type='radio' disabled='disabled' "+(val?"checked='checked'": "")+" />"
+                                 }
+                             }]];
+
+                var mem = new Memory({ data: truststores, idProperty: "id"});
+                truststoreWidget.set("store", new ObjectStore({objectStore: mem}));
+                truststoreWidget.set("structure", layout);
+                truststoreWidget.rowSelectCell.toggleAllSelection(false);
+                truststoreWidget.startup();
+            }
+
             if (portName)
             {
                 xhr.get({
@@ -291,11 +399,32 @@ define(["dojo/_base/xhr",
                        nameField.set("disabled", true);
                        dom.byId("formAddPort.id").value=port.id;
                        providerWidget.set("value", port.authenticationProvider ? port.authenticationProvider : "");
+                       keystoreWidget.set("value", port.keyStore ? port.keyStore : "");
+                       if (port.trustStores)
+                       {
+                         var items = truststoreWidget.store.objectStore.data;
+                         for (var j=0; j< items.length; j++)
+                         {
+                           var selected = false;
+                           for (var i=0; i< port.trustStores.length; i++)
+                           {
+                             var trustStore = port.trustStores[i];
+                             if (items[j].name == trustStore)
+                             {
+                               selected = true;
+                               break;
+                             }
+                           }
+                           truststoreWidget.selection.setSelected(j,selected);
+                         }
+                       }
+
                        var transportWidget = registry.byId("formAddPort.transports");
                        transportWidget.set("value", port.transports ? port.transports[0] : "");
                        registry.byId("formAddPort.port").set("value", port.port);
                        var protocols = port.protocols;
                        var typeWidget = registry.byId("formAddPort.type");
+
                        var store = typeWidget.store;
                        store.data.forEach(function(option){
                            registry.byId("formAddPort.protocols" + option.value).set("disabled", true);
@@ -310,7 +439,7 @@ define(["dojo/_base/xhr",
                            var defaultProtocolsWidget = registry.byId("formAddPort.protocolsDefault");
                            var addressWidget = registry.byId("formAddPort.bindingAddress");
                            addressWidget.set("value", port.bindingAddress);
-                           amqpProtocolsWidget.set("disabled", false);
+
                            if (protocols)
                            {
                                amqpProtocolsWidget.set("value", protocols)
@@ -343,16 +472,24 @@ define(["dojo/_base/xhr",
                        registry.byId("formAddPort:fields" + typeWidget.value).domNode.style.display = "block";
                        typeWidget.set("disabled", true);
 
-                       toggleCertificateWidgets(typeWidget.value, transportWidget.value);
+                       keystoreWidget.initialValue = port.keyStore;
+                       truststoreWidget.initialValue = port.trustStores;
+                       transportWidget.initialValue = transportWidget.value;
+                       providerWidget.initialValue = providerWidget.value;
+
                        registry.byId("addPort").show();
                });
             }
             else
             {
                 var typeWidget = registry.byId("formAddPort.type");
-                typeWidget.set("disabled", false);
+                if (typeWidget.get("disabled"))
+                {
+                  typeWidget.set("disabled", false);
+                }
                 typeWidget.set("value", "AMQP");
-                registry.byId("formAddPort.name").set("disabled", false);
+                var name = registry.byId("formAddPort.name");
+                name.set("disabled", false);
                 registry.byId("addPort").show();
             }
         };

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js Tue Apr 23 20:54:19 2013
@@ -29,15 +29,20 @@ define(["dojo/dom",
         "qpid/management/AuthenticationProvider",
         "qpid/management/GroupProvider",
         "qpid/management/group/Group",
+        "qpid/management/KeyStore",
+        "qpid/management/TrustStore",
+        "qpid/management/AccessControlProvider",
+        "qpid/management/Port",
         "dojo/ready",
         "dojo/domReady!"],
-       function (dom, registry, ContentPane, Broker, VirtualHost, Exchange, Queue, Connection, AuthProvider, GroupProvider, Group, ready) {
+       function (dom, registry, ContentPane, Broker, VirtualHost, Exchange, Queue, Connection, AuthProvider, GroupProvider, Group, KeyStore, TrustStore, AccessControlProvider, Port, ready) {
            var controller = {};
 
            var constructors = { broker: Broker, virtualhost: VirtualHost, exchange: Exchange,
                                 queue: Queue, connection: Connection,
                                 authenticationprovider: AuthProvider, groupprovider: GroupProvider,
-                                group: Group };
+                                group: Group, keystore: KeyStore, truststore: TrustStore,
+                                accesscontrolprovider: AccessControlProvider, port: Port};
 
            var tabDiv = dom.byId("managedViews");
 

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/groupprovider/FileGroupManager.js Tue Apr 23 20:54:19 2013
@@ -82,11 +82,12 @@ define(["dojo/_base/xhr",
 
             xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
                .then(function(data) {
+                     that.path = query(".path", node)[0];
                      that.groupProviderData = data[0];
 
                      util.flattenStatistics( that.groupProviderData );
 
-                     var groupDiv = query(".groups")[0];
+                     var groupDiv = query(".groups", node)[0];
 
                      var gridProperties = {
                                             height: 400,
@@ -109,7 +110,15 @@ define(["dojo/_base/xhr",
                      that.groupsGrid =
                         new UpdatableStore(that.groupProviderData.groups, groupDiv,
                                         [ { name: "Group Name",    field: "name",      width: "100%" }
-                                        ], null, gridProperties, EnhancedGrid);
+                                        ], function(obj) {
+                                          connect.connect(obj.grid, "onRowDblClick", obj.grid,
+                                              function(evt){
+                                                  var idx = evt.rowIndex,
+                                                      theItem = this.getItem(idx);
+                                                  var name = obj.dataStore.getValue(theItem,"name");
+                                                  that.controller.show("group", name, groupProviderObj);
+                                              });
+                                      }, gridProperties, EnhancedGrid);
 
 
                      var addGroupButton = query(".addGroupButton", node)[0];
@@ -167,6 +176,7 @@ define(["dojo/_base/xhr",
             xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
                 .then(function(data) {
                     that.groupProviderData = data[0];
+                    that.path.innerHTML = that.groupProviderData.path;
                     util.flattenStatistics( that.groupProviderData );
 
                     that.groupsGrid.update(that.groupProviderData.groups);

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js Tue Apr 23 20:54:19 2013
@@ -277,8 +277,13 @@ define(["dojo/_base/xhr",
                    controller.show("groupprovider", details.groupprovider, {broker: {type:"broker", name:""}});
                } else if (details.type == 'group') {
                    controller.show("group", details.group, { type: "groupprovider", name: details.groupprovider, parent: {broker: {type:"broker", name:""}}});
+               } else if (details.type == 'keystore') {
+                 controller.show("keystore", details.keystore, {broker: {type:"broker", name:""}});
+               } else if (details.type == 'truststore') {
+                 controller.show("truststore", details.truststore, {broker: {type:"broker", name:""}});
+               } else if (details.type == 'accesscontrolprovider') {
+                 controller.show("accesscontrolprovider", details.accesscontrolprovider, {broker: {type:"broker", name:""}});
                }
-
            };
 
            TreeViewModel.prototype.update = function () {

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showBroker.html Tue Apr 23 20:54:19 2013
@@ -53,36 +53,10 @@
                 <div class="formLabel-labelCell" style="float:left; width: 250px;">Broker store location:</div>
                 <div id="brokerAttribute.storePath" style="float:left;"></div>
             </div>
-            <div id="brokerAttribute.defaultAuthenticationProvider.container" style="display: none; clear:both">
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">Default authentication provider:</div>
-                <div id="brokerAttribute.defaultAuthenticationProvider" style="float:left;"></div>
-            </div>
             <div id="brokerAttribute.defaultVirtualHost.container" style="display: none; clear:both; clear:both;">
                 <div class="formLabel-labelCell" style="float:left; width: 250px;">Default virtual host:</div>
                 <div id="brokerAttribute.defaultVirtualHost" style="float:left;"></div>
             </div>
-            <div id="brokerAttribute.aclFile.container" style="display: none; clear:both">
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">ACL file location:</div>
-                <div id="brokerAttribute.aclFile" style="float:left;"></div>
-            </div>
-            <div id="brokerAttribute.groupFile.container" style="display: none; clear:both">
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">Group file location:</div>
-                <div id="brokerAttribute.groupFile" style="float:left;"></div>
-            </div>
-            <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 certificate alias:</div>
-                <div id="brokerAttribute.keyStoreCertAlias" style="float:left;"></div>
-            </div>
-            <div id="brokerAttribute.trustStorePath.container" style="display: none; clear:both">
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">Path to truststore:</div>
-                <div id="brokerAttribute.trustStorePath" style="float:left;"></div>
-            </div>
-            <div id="brokerAttribute.peerStorePath.container" style="display: none; clear:both">
-                <div class="formLabel-labelCell" style="float:left; width: 250px;">Path to peerstore:</div>
-                <div id="brokerAttribute.peerStorePath" style="float:left;"></div>
-            </div>
             <div id="brokerAttribute.statisticsReportingPeriod.container" style="display: none; clear:both">
                 <div class="formLabel-labelCell" style="float:left; width: 250px;">Statistics reporting period:</div>
                 <div id="brokerAttribute.statisticsReportingPeriod" style="float:left;"></div>
@@ -191,6 +165,31 @@
         <button data-dojo-type="dijit.form.Button" class="deleteAuthenticationProvider">Delete Provider</button>
     </div>
     <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Key stores'">
+        <div class="broker-key-stores"></div>
+        <button data-dojo-type="dijit.form.Button" class="addKeystore">Add Key Store</button>
+        <button data-dojo-type="dijit.form.Button" class="deleteKeystore">Delete Key Store</button>
+    </div>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Trust stores'">
+        <div class="broker-trust-stores"></div>
+        <button data-dojo-type="dijit.form.Button" class="addTruststore">Add Trust Store</button>
+        <button data-dojo-type="dijit.form.Button" class="deleteTruststore">Delete Trust Store</button>
+    </div>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Group Providers'">
+        <div class="broker-group-providers"></div>
+        <button data-dojo-type="dijit.form.Button" class="addGroupProvider">Add Group Provider</button>
+        <button data-dojo-type="dijit.form.Button" class="deleteGroupProvider">Delete Group Provider</button>
+    </div>
+    <br/>
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Access Control Providers'">
+        <div class="broker-access-control-providers-warning" style="color: red"></div>
+        <div class="broker-access-control-providers"></div>
+        <button data-dojo-type="dijit.form.Button" class="addAccessControlProvider">Add Access Control Provider</button>
+        <button data-dojo-type="dijit.form.Button" class="deleteAccessControlProvider">Delete Access Control Provider</button>
+    </div>
+    <br/>
     <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Log File',  open: false">
         <div class="broker-logfile"></div>
     </div>

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showGroupProvider.html
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showGroupProvider.html?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showGroupProvider.html (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-http/src/main/java/resources/showGroupProvider.html Tue Apr 23 20:54:19 2013
@@ -22,4 +22,10 @@
     <span style="">Name:</span><span class="name" style="position:absolute; left:6em"></span>
     <br/>
     <span style="">Type:</span><span class="type" style="position:absolute; left:6em"></span>
-</div>
\ No newline at end of file
+    <br/>
+    <div class="providerDetails"></div>
+    <div class="dijitDialogPaneActionBar">
+        <input class="deleteGroupProviderButton" type="button" value="Delete Group provider" label="Delete Group Provider" dojoType="dijit.form.Button" />
+    </div>
+</div>
+<br/>
\ No newline at end of file

Modified: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagedObjectRegistry.java Tue Apr 23 20:54:19 2013
@@ -22,14 +22,15 @@ package org.apache.qpid.server.jmx;
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.configuration.BrokerProperties;
-import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.messages.ManagementConsoleMessages;
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.KeyStore;
 import org.apache.qpid.server.model.Port;
 import org.apache.qpid.server.model.Transport;
 
-import org.apache.qpid.server.security.auth.rmi.RMIPasswordAuthenticator;
+import org.apache.qpid.server.security.auth.jmx.JMXPasswordAuthenticator;
+import org.apache.qpid.ssl.SSLContextFactory;
 
 import javax.management.JMException;
 import javax.management.MBeanServer;
@@ -39,10 +40,8 @@ import javax.management.remote.JMXConnec
 import javax.management.remote.JMXServiceURL;
 import javax.management.remote.MBeanServerForwarder;
 import javax.management.remote.rmi.RMIConnectorServer;
+import javax.net.ssl.SSLContext;
 import javax.rmi.ssl.SslRMIClientSocketFactory;
-import javax.rmi.ssl.SslRMIServerSocketFactory;
-import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 import java.net.InetAddress;
@@ -57,6 +56,7 @@ import java.rmi.registry.Registry;
 import java.rmi.server.RMIClientSocketFactory;
 import java.rmi.server.RMIServerSocketFactory;
 import java.rmi.server.UnicastRemoteObject;
+import java.security.GeneralSecurityException;
 import java.util.HashMap;
 
 /**
@@ -122,16 +122,32 @@ public class JMXManagedObjectRegistry im
 
         if (connectorSslEnabled)
         {
-            String keyStorePath = System.getProperty("javax.net.ssl.keyStore");
-            String keyStorePassword = System.getProperty("javax.net.ssl.keyStorePassword");
+            KeyStore keyStore = _connectorPort.getKeyStore();
 
-            validateKeyStoreProperties(keyStorePath, keyStorePassword);
+            String keyStorePath = (String) keyStore.getAttribute(KeyStore.PATH);
+            String keyStorePassword = keyStore.getPassword();
+            String keyStoreType = (String) keyStore.getAttribute(KeyStore.TYPE);
+            String keyManagerFactoryAlgorithm = (String) keyStore.getAttribute(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM);
+
+            SSLContext sslContext;
+            try
+            {
+                sslContext = SSLContextFactory.buildServerContext(keyStorePath, keyStorePassword, keyStoreType, keyManagerFactoryAlgorithm);
+            }
+            catch (GeneralSecurityException e)
+            {
+                throw new RuntimeException("Unable to create SSLContext for key store", e);
+            }
+            catch (IOException e)
+            {
+                throw new RuntimeException("Unable to create SSLContext for key store", e);
+            }
 
             CurrentActor.get().message(ManagementConsoleMessages.SSL_KEYSTORE(keyStorePath));
 
             //create the SSL RMI socket factories
             csf = new SslRMIClientSocketFactory();
-            ssf = new SslRMIServerSocketFactory();
+            ssf = new QpidSslRMIServerSocketFactory(sslContext);
         }
         else
         {
@@ -144,7 +160,7 @@ public class JMXManagedObjectRegistry im
         int jmxPortConnectorServer = _connectorPort.getPort();
 
         //add a JMXAuthenticator implementation the env map to authenticate the RMI based JMX connector server
-        RMIPasswordAuthenticator rmipa = new RMIPasswordAuthenticator(_broker, new InetSocketAddress(jmxPortConnectorServer));
+        JMXPasswordAuthenticator rmipa = new JMXPasswordAuthenticator(_broker, new InetSocketAddress(jmxPortConnectorServer));
         HashMap<String,Object> connectorEnv = new HashMap<String,Object>();
         connectorEnv.put(JMXConnectorServer.AUTHENTICATOR, rmipa);
 
@@ -262,31 +278,6 @@ public class JMXManagedObjectRegistry im
         return rmiRegistry;
     }
 
-    private void validateKeyStoreProperties(String keyStorePath, String keyStorePassword) throws FileNotFoundException
-    {
-        if (keyStorePath == null)
-        {
-            throw new IllegalConfigurationException("JVM system property 'javax.net.ssl.keyStore' is not set, "
-                    + "unable to start requested SSL protected JMX connector");
-        }
-        if (keyStorePassword == null)
-        {
-            throw new IllegalConfigurationException( "JVM system property 'javax.net.ssl.keyStorePassword' is not set, "
-                    + "unable to start requested SSL protected JMX connector");
-        }
-
-        File ksf = new File(keyStorePath);
-        if (!ksf.exists())
-        {
-            throw new FileNotFoundException("Cannot find SSL keystore file for JMX management: " + ksf);
-        }
-        if (!ksf.canRead())
-        {
-            throw new FileNotFoundException("Cannot read SSL keystore file for JMX management: "
-                                            + ksf +  ". Check permissions.");
-        }
-    }
-
     @Override
     public void registerObject(ManagedObject managedObject) throws JMException
     {

Copied: qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java (from r1467334, qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java)
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java?p2=qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java&p1=qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java&r1=1467334&r2=1471141&rev=1471141&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java (original)
+++ qpid/branches/QPID-4659/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/QpidSslRMIServerSocketFactory.java Tue Apr 23 20:54:19 2013
@@ -1,3 +1,23 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
 package org.apache.qpid.server.jmx;
 
 import java.io.IOException;

Propchange: qpid/branches/QPID-4659/qpid/java/broker/bin/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/broker/bin:r1463061,1465459,1465590,1466482,1467334,1467922,1467930,1467932,1467938,1467940,1467992,1468815-1468816,1468830,1468875,1468953,1469256,1469914,1469916-1469917,1469937,1470439,1470454,1470457,1470463,1470474,1470897,1470899,1471004

Modified: qpid/branches/QPID-4659/qpid/java/broker/etc/md5passwd
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker/etc/md5passwd?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker/etc/md5passwd (original)
+++ qpid/branches/QPID-4659/qpid/java/broker/etc/md5passwd Tue Apr 23 20:54:19 2013
@@ -20,3 +20,4 @@ guest:CE4DQ6BIb/BVMN9scFyLtA==
 client:CE4DQ6BIb/BVMN9scFyLtA==
 server:CE4DQ6BIb/BVMN9scFyLtA==
 admin:ISMvKXpXpadDiUoOSoAfww==
+webadmin:rda7WOE5vhAzJNBNgtj1RQ==

Modified: qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java (original)
+++ qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/Broker.java Tue Apr 23 20:54:19 2013
@@ -124,7 +124,7 @@ public class Broker
         }
 
         BrokerConfigurationStoreCreator storeCreator = new BrokerConfigurationStoreCreator();
-        ConfigurationEntryStore store = storeCreator.createStore(storeLocation, storeType, options.getInitialConfigurationLocation());
+        ConfigurationEntryStore store = storeCreator.createStore(storeLocation, storeType, options.getInitialConfigurationLocation(), options.isOverwriteConfigurationStore());
 
         if (options.isManagementMode())
         {
@@ -134,7 +134,7 @@ public class Broker
         _applicationRegistry = new ApplicationRegistry(store);
         try
         {
-            _applicationRegistry.initialise();
+            _applicationRegistry.initialise(options);
         }
         catch(Exception e)
         {

Modified: qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java
URL: http://svn.apache.org/viewvc/qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java?rev=1471141&r1=1471140&r2=1471141&view=diff
==============================================================================
--- qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java (original)
+++ qpid/branches/QPID-4659/qpid/java/broker/src/main/java/org/apache/qpid/server/BrokerOptions.java Tue Apr 23 20:54:19 2013
@@ -24,15 +24,19 @@ import java.io.File;
 
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.configuration.ConfigurationEntryStore;
-import org.apache.qpid.server.configuration.store.JsonConfigurationEntryStore;
+import org.apache.qpid.server.configuration.store.MemoryConfigurationEntryStore;
+import org.apache.qpid.server.util.StringUtil;
 
 public class BrokerOptions
 {
+    public static final String DEFAULT_INITIAL_CONFIG_NAME = "initial-config.json";
     public static final String DEFAULT_STORE_TYPE = "json";
     public static final String DEFAULT_CONFIG_NAME_PREFIX = "config";
     public static final String DEFAULT_LOG_CONFIG_FILE = "etc/log4j.xml";
     public static final String DEFAULT_INITIAL_CONFIG_LOCATION =
-        BrokerOptions.class.getClassLoader().getResource("initial-store.json").toExternalForm();
+        BrokerOptions.class.getClassLoader().getResource(DEFAULT_INITIAL_CONFIG_NAME).toExternalForm();
+    public static final String MANAGEMENT_MODE_USER_NAME = "mm_admin";
+    private static final int MANAGEMENT_MODE_PASSWORD_LENGTH = 10;
 
     private String _logConfigFile;
     private Integer _logWatchFrequency = 0;
@@ -43,17 +47,35 @@ public class BrokerOptions
     private String _initialConfigurationLocation;
 
     private boolean _managementMode;
+    private boolean _managementModeQuiesceVhosts;
     private int _managementModeRmiPort;
     private int _managementModeConnectorPort;
     private int _managementModeHttpPort;
+    private String _managementModePassword;
     private String _workingDir;
     private boolean _skipLoggingConfiguration;
+    private boolean _overwriteConfigurationStore;
 
     public String getLogConfigFile()
     {
         return _logConfigFile;
     }
 
+    public String getManagementModePassword()
+    {
+        if(_managementModePassword == null)
+        {
+            _managementModePassword = new StringUtil().randomAlphaNumericString(MANAGEMENT_MODE_PASSWORD_LENGTH);
+        }
+
+        return _managementModePassword;
+    }
+
+    public void setManagementModePassword(String managementModePassword)
+    {
+        _managementModePassword = managementModePassword;
+    }
+
     public void setLogConfigFile(final String logConfigFile)
     {
         _logConfigFile = logConfigFile;
@@ -83,6 +105,16 @@ public class BrokerOptions
         _managementMode = managementMode;
     }
 
+    public boolean isManagementModeQuiesceVirtualHosts()
+    {
+        return _managementModeQuiesceVhosts;
+    }
+
+    public void setManagementModeQuiesceVirtualHosts(boolean managementModeQuiesceVhosts)
+    {
+        _managementModeQuiesceVhosts = managementModeQuiesceVhosts;
+    }
+
     public int getManagementModeRmiPort()
     {
         return _managementModeRmiPort;
@@ -169,6 +201,24 @@ public class BrokerOptions
     }
 
     /**
+     * Returns whether the existing broker configuration store should be overwritten with the current
+     * initial configuration file (see {@link BrokerOptions#getInitialConfigurationLocation()}).
+     */
+    public boolean isOverwriteConfigurationStore()
+    {
+        return _overwriteConfigurationStore;
+    }
+
+    /**
+     * Sets whether the existing broker configuration store should be overwritten with the current
+     * initial configuration file (see {@link BrokerOptions#getInitialConfigurationLocation()}).
+     */
+    public void setOverwriteConfigurationStore(boolean overwrite)
+    {
+        _overwriteConfigurationStore = overwrite;
+    }
+
+    /**
      * Get the broker work directory location.
      *
      * Defaults to the location set in the "QPID_WORK" system property if it is set, or the 'work' sub-directory
@@ -205,7 +255,7 @@ public class BrokerOptions
     /**
      * Get the broker initial JSON configuration location.
      *
-     * Defaults to an internal configuration file within the broker jar, which is loaded with the {@link JsonConfigurationEntryStore}.
+     * Defaults to an internal configuration file within the broker jar.
      *
      * @return the previously set configuration location, or the default location if none was set.
      */
@@ -221,7 +271,7 @@ public class BrokerOptions
 
     /**
      * Set the absolute path or URL to use for the initial JSON configuration, which is loaded with the
-     * {@link JsonConfigurationEntryStore} in order to initialise any new {@link ConfigurationEntryStore} for the broker.
+     * {@link MemoryConfigurationEntryStore} in order to initialise any new {@link ConfigurationEntryStore} for the broker.
      *
      * Passing null clears any previously set value and returns to the default.
      */



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


Mime
View raw message