You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2018/05/01 14:36:52 UTC
qpid-broker-j git commit: QPID-8176: [Broker-J] Use broker REST API
to check broker availability
Repository: qpid-broker-j
Updated Branches:
refs/heads/7.0.x c8593eb36 -> df93e6afd
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/df93e6af
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/df93e6af
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/df93e6af
Branch: refs/heads/7.0.x
Commit: df93e6afd575db71d44c827200956eaa631fe975
Parents: c8593eb
Author: Alex Rudyy <or...@apache.org>
Authored: Fri Apr 27 15:59:30 2018 +0100
Committer: Keith Wall <kw...@apache.org>
Committed: Tue May 1 15:36:30 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/df93e6af/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