summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker/StatusWorker.java
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-10 13:25:52 +0200
committerBjörn Geiger2011-08-10 13:25:52 +0200
commitad7f740c14f4dc96d5d6a484fcc851c760152556 (patch)
tree5d41cf6c57245c70cfc10d88d3a33212ee0d6f87 /gearman/controllerWorker/ControllerWorker/StatusWorker.java
parentminor (diff)
downloadpoolctrl-ad7f740c14f4dc96d5d6a484fcc851c760152556.tar.gz
poolctrl-ad7f740c14f4dc96d5d6a484fcc851c760152556.tar.xz
poolctrl-ad7f740c14f4dc96d5d6a484fcc851c760152556.zip
minor
Diffstat (limited to 'gearman/controllerWorker/ControllerWorker/StatusWorker.java')
-rw-r--r--gearman/controllerWorker/ControllerWorker/StatusWorker.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/StatusWorker.java b/gearman/controllerWorker/ControllerWorker/StatusWorker.java
index 7343ba5..72dedbd 100644
--- a/gearman/controllerWorker/ControllerWorker/StatusWorker.java
+++ b/gearman/controllerWorker/ControllerWorker/StatusWorker.java
@@ -42,11 +42,11 @@ public class StatusWorker extends AbstractGearmanFunction {
Vector<HashMap<String, String>> clients = boot.getClients();
if (boot.isFinished()) {
- res[count] = "Booting of " + event + " finished!";
+ res[count] = "Booting of " + event + " has been finished!";
boot = null;
} else if (boot.isFinishedWithErrors()) {
res[count] = "Booting of " + event
- + " finished with errors!";
+ + " has not been finished, due to errors!";
String[] clientErrors = new String[clients.size()];
int statusCount = 0;
for (HashMap<String, String> client : clients) {
@@ -60,7 +60,8 @@ public class StatusWorker extends AbstractGearmanFunction {
.toJSONString(clientErrors);
res[count] += jsonClientErrors;
} else {
- res[count] = "Booting of " + event + " not yet finished!";
+ res[count] = "Booting of " + event
+ + " has not yet been finished!";
String[] clientStatus = new String[clients.size()];
int statusCount = 0;
for (HashMap<String, String> client : clients) {
@@ -80,14 +81,28 @@ public class StatusWorker extends AbstractGearmanFunction {
} else if (type.equals("shutdown")) {
for (String event : events) {
Shutdown shutdown = SHUTDOWNTHREADS.get(event);
+ Vector<HashMap<String, String>> clients = shutdown.getClients();
if (shutdown.isFinished()) {
- res[count] = "Shutdown of " + event + " finished!";
+ res[count] = "Shutdown of " + event + " has been finished!";
} else if (shutdown.isFinishedWithErrors()) {
res[count] = "Shutdown of " + event
+ " finished with errors!";
} else {
- res[count] = "Shutdown of " + event + " not yet finished!";
+ res[count] = "Shutdown of " + event
+ + " has not yet been finished!";
+ String[] clientStatus = new String[clients.size()];
+ int statusCount = 0;
+ for (HashMap<String, String> client : clients) {
+ String ipAddress = client.get("ip");
+ String statusText = shutdown.getStatusText(client);
+ clientStatus[statusCount] = "Status of the client with the ip "
+ + ipAddress + ": " + statusText;
+ statusCount++;
+ }
+ String jsonClientStatus = JSONValue
+ .toJSONString(clientStatus);
+ res[count] += jsonClientStatus;
}
count++;