summaryrefslogtreecommitdiffstats
path: root/gearman/controllerWorker/ControllerWorker/Shutdown.java
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-16 13:24:36 +0200
committerBjörn Geiger2011-08-16 13:24:36 +0200
commit0fca47d0e9c16537090ac2b0d35bace00d06bfcc (patch)
tree9a4a9a47002c4bc72e6a4c352fae8c66d3822f4b /gearman/controllerWorker/ControllerWorker/Shutdown.java
parentkleine Korrektur (diff)
downloadpoolctrl-0fca47d0e9c16537090ac2b0d35bace00d06bfcc.tar.gz
poolctrl-0fca47d0e9c16537090ac2b0d35bace00d06bfcc.tar.xz
poolctrl-0fca47d0e9c16537090ac2b0d35bace00d06bfcc.zip
verschiedene Korrekturen
Diffstat (limited to 'gearman/controllerWorker/ControllerWorker/Shutdown.java')
-rw-r--r--gearman/controllerWorker/ControllerWorker/Shutdown.java37
1 files changed, 22 insertions, 15 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/Shutdown.java b/gearman/controllerWorker/ControllerWorker/Shutdown.java
index 01c2407..ef8e7c4 100644
--- a/gearman/controllerWorker/ControllerWorker/Shutdown.java
+++ b/gearman/controllerWorker/ControllerWorker/Shutdown.java
@@ -214,21 +214,28 @@ public class Shutdown extends Thread {
GearmanJobResult wolJobRes = shutdownJob.get();
String result = ByteUtils.fromUTF8Bytes(wolJobRes
.getResults());
- System.out.println(result.toString());
- if (result.equals("")) {
- System.out.println(ipAddress
- + " Shutdown command send");
- status.put(clientID, 6); // shutdown command send
- shutdownJobs.remove(clientID);
- } else {
- System.out.println(ipAddress
- + " Cannot send shutdown command");
- this.errors
- .put(clientID,
- "Sending the shutdown command has been failed.");
- // cannot send shutdown command, go in errorState
- status.put(clientID, 12);
- shutdownJobs.remove(clientID);
+ if (result != "") {
+ JSONObject resultObj = (JSONObject) JSONValue
+ .parse(result);
+ String rawoutput = resultObj.get("rawoutput")
+ .toString();
+ if (rawoutput.equals("")) {
+ System.out.println(ipAddress
+ + " Shutdown command send");
+ status.put(clientID, 6); // shutdown command
+ // send
+ shutdownJobs.remove(clientID);
+ } else {
+ System.out.println(ipAddress
+ + " Cannot send shutdown command");
+ this.errors
+ .put(clientID,
+ "Sending the shutdown command has been failed.");
+ // cannot send shutdown command, go in
+ // errorState
+ status.put(clientID, 12);
+ shutdownJobs.remove(clientID);
+ }
}
}
}