qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject qpid-broker-j git commit: QPID-8176: [Broker-J] Use broker REST API to check broker availability
Date Fri, 27 Apr 2018 15:01:50 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master ddc519a55 -> 23e968d0d


QPID-8176: [Broker-J] Use broker REST API to check broker availability


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/23e968d0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/23e968d0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/23e968d0

Branch: refs/heads/master
Commit: 23e968d0d538b486d3714e243fd958630477200c
Parents: ddc519a
Author: Alex Rudyy <orudyy@apache.org>
Authored: Fri Apr 27 15:59:30 2018 +0100
Committer: Oleksandr Rudyy <oleksandr.rudyy@jpmchase.net>
Committed: Fri Apr 27 16:00:00 2018 +0100

----------------------------------------------------------------------
 .../java/resources/js/qpid/management/Broker.js    | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/23e968d0/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
index 0649558..80e113c 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js
@@ -337,7 +337,8 @@ define(["dojo/parser",
                         + " All messaging operations will be interrupted until applications
reconnect."
                         + " Are you certain you wish to proceed?"))
             {
-                this.management.post({url: this.management.objectToURL(this.modelObj) + "/restart"},
{})
+                var brokerUrl = this.management.objectToURL(this.modelObj);
+                this.management.post({url: brokerUrl + "/restart"}, {})
                     .then(lang.hitch(this, function ()
                     {
                         updater.cancel();
@@ -345,14 +346,24 @@ define(["dojo/parser",
                         document.body.appendChild(standby.domNode);
                         standby.startup();
                         standby.show();
-                        var pollUrl = this.management.getFullUrl("/");
                         var logout = function ()
                         {
                             window.location = "logout";
                         };
                         var ping = function ()
                         {
-                            xhr(pollUrl, {method: "GET"}).then(logout, ping);
+                            xhr(brokerUrl, {method: "GET"})
+                                .then(logout,
+                                    function (error) {
+                                        if (error.response.status === 401 || error.response.status
=== 403)
+                                        {
+                                            logout();
+                                        }
+                                        else
+                                        {
+                                            ping();
+                                        }
+                                    });
                         };
                         var timer = setInterval(lang.hitch(this, ping), 5000);
                     }));


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


Mime
View raw message