summaryrefslogtreecommitdiffstats
path: root/gearman
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-10 13:09:14 +0200
committerBjörn Geiger2011-08-10 13:09:14 +0200
commite6f695cdac26c5fe0e7b6bab26b669d2b09544ee (patch)
treea3bf361d1148d6dfbdb71d863090a26fb6687976 /gearman
parentverschiedenes (diff)
downloadpoolctrl-e6f695cdac26c5fe0e7b6bab26b669d2b09544ee.tar.gz
poolctrl-e6f695cdac26c5fe0e7b6bab26b669d2b09544ee.tar.xz
poolctrl-e6f695cdac26c5fe0e7b6bab26b669d2b09544ee.zip
minor
Diffstat (limited to 'gearman')
-rw-r--r--gearman/controllerWorker/ControllerWorker/Boot.java22
-rw-r--r--gearman/controllerWorker/ControllerWorker/Shutdown.java51
2 files changed, 28 insertions, 45 deletions
diff --git a/gearman/controllerWorker/ControllerWorker/Boot.java b/gearman/controllerWorker/ControllerWorker/Boot.java
index 3fe6a05..3d2db11 100644
--- a/gearman/controllerWorker/ControllerWorker/Boot.java
+++ b/gearman/controllerWorker/ControllerWorker/Boot.java
@@ -80,26 +80,26 @@ public class Boot extends Thread {
this.error = false;
this.bootOS = bootOS;
this.statusText = new String[20];
- this.statusText[0] = "Booting has been started.";
- this.statusText[1] = "Ping has been started.";
- this.statusText[2] = "Client is alive.";
- this.statusText[3] = "Client is not alive.";
- this.statusText[4] = "Wake on LAN has been started.";
- this.statusText[5] = "Magic packet has been send.";
- this.statusText[6] = "Ping after wake on LAN has been started.";
+ this.statusText[0] = "The booting process of the client has been started.";
+ this.statusText[1] = "The ping has been started.";
+ this.statusText[2] = "The client is alive.";
+ this.statusText[3] = "The client is not alive.";
+ this.statusText[4] = "The wake on LAN has been started.";
+ this.statusText[5] = "The Magic packet has been send.";
+ this.statusText[6] = "The ping after wake on LAN has been started.";
this.statusText[7] = "Doing ping after wake on LAN again and again, until client is alive or two minutes has been elapsed";
this.statusText[8] = "The check for the correct operating system has been started.";
- this.statusText[9] = "Wrong operating system is running.";
+ this.statusText[9] = "The wrong operating system is running.";
this.statusText[10] = "The check if a user is logged in has been started.";
this.statusText[11] = "A user is logged in.";
this.statusText[12] = "The check if the user is working has been started.";
this.statusText[13] = "The user is not working.";
this.statusText[14] = "A restart of the client has been triggered.";
- this.statusText[15] = "Ping after restart has been started.";
+ this.statusText[15] = "The ping after restart has been started.";
this.statusText[16] = "Doing ping after restart again and again, until client is alive or two minutes has been elapsed";
this.statusText[17] = "The user is working.";
- this.statusText[18] = "Booting has not been finished, due to an error.";
- this.statusText[19] = "Booting has been finished.";
+ this.statusText[18] = "Booting of the client has not been finished, due to an error.";
+ this.statusText[19] = "Booting of the client has been finished.";
}
public void run() {
diff --git a/gearman/controllerWorker/ControllerWorker/Shutdown.java b/gearman/controllerWorker/ControllerWorker/Shutdown.java
index b174156..1058464 100644
--- a/gearman/controllerWorker/ControllerWorker/Shutdown.java
+++ b/gearman/controllerWorker/ControllerWorker/Shutdown.java
@@ -28,6 +28,7 @@ public class Shutdown extends Thread {
private Boolean error;
private final int updateRate;
private final long updatePeriod;
+ private String[] statusText;
private HashMap<Integer, GearmanJob> pingJobs;
private HashMap<Integer, GearmanJob> whoJobs;
@@ -35,7 +36,7 @@ public class Shutdown extends Thread {
private HashMap<Integer, GearmanJob> pingShutdownJobs;
private HashMap<Integer, GearmanJob> sshJobs;
private HashMap<Integer, Integer> status;
- private HashMap<Integer, Integer> errors;
+ private HashMap<Integer, String> errors;
private HashMap<Integer, Long> pingShutdownTime;
private Vector<HashMap<String, String>> clients;
@@ -50,7 +51,7 @@ public class Shutdown extends Thread {
this.shutdownJobs = new HashMap<Integer, GearmanJob>();
this.sshJobs = new HashMap<Integer, GearmanJob>();
this.status = new HashMap<Integer, Integer>();
- this.errors = new HashMap<Integer, Integer>();
+ this.errors = new HashMap<Integer, String>();
this.updateRate = updateRate; // updates per second
this.updatePeriod = 1000000000L / this.updateRate; // nanoseconds
this.gearmanConnection = new GearmanNIOJobServerConnection(
@@ -64,6 +65,8 @@ public class Shutdown extends Thread {
}
this.finished = false;
this.error = false;
+ this.statusText = new String[20];
+ this.statusText[0] = "The shutdown process of the client has been started.";
}
public void run() {
@@ -298,40 +301,16 @@ public class Shutdown extends Thread {
System.out.println("ssh " + ipAddress);
}
- public Vector<HashMap<String, String>> getClients() {
- return clients;
- }
-
- public GearmanClient getGearmanClient() {
- return gearmanClient;
- }
-
- public GearmanJobServerConnection getGearmanConnection() {
- return gearmanConnection;
- }
-
- public HashMap<Integer, GearmanJob> getPingJobs() {
- return pingJobs;
- }
-
- public HashMap<Integer, GearmanJob> getSshJobs() {
- return sshJobs;
- }
-
- public HashMap<Integer, GearmanJob> getWhoJobs() {
- return whoJobs;
- }
-
- public HashMap<Integer, GearmanJob> getShutdownJobs() {
- return shutdownJobs;
- }
-
- public HashMap<Integer, Integer> getStatus() {
- return status;
+ public String getStatusText(HashMap<String, String> client) {
+ int clientID = Integer.parseInt(client.get("id"));
+ int clientStatus = this.status.get(clientID);
+ return this.statusText[clientStatus];
}
- public HashMap<Integer, Integer> getErrors() {
- return errors;
+ public String getError(HashMap<String, String> client) {
+ int clientID = Integer.parseInt(client.get("id"));
+ String clientError = this.errors.get(clientID);
+ return clientError;
}
public Boolean isFinished() {
@@ -341,4 +320,8 @@ public class Shutdown extends Thread {
public Boolean isFinishedWithErrors() {
return finished && error;
}
+
+ public Vector<HashMap<String, String>> getClients() {
+ return clients;
+ }
} \ No newline at end of file