From e4a71a7bd7fae33b9e31f6615e4a2056f3cfffe0 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Tue, 16 Aug 2011 15:31:49 +0200 Subject: verschiedenes --- .../controllerWorker/ControllerWorker/Boot.java | 24 ++++++++++++---------- .../ControllerWorker/Shutdown.java | 20 ++++++++++-------- 2 files changed, 24 insertions(+), 20 deletions(-) (limited to 'gearman') diff --git a/gearman/controllerWorker/ControllerWorker/Boot.java b/gearman/controllerWorker/ControllerWorker/Boot.java index 54a0ede..7f40059 100644 --- a/gearman/controllerWorker/ControllerWorker/Boot.java +++ b/gearman/controllerWorker/ControllerWorker/Boot.java @@ -156,7 +156,7 @@ public class Boot extends Thread { GearmanJobResult pingJobRes = pingJob.get(); String result = ByteUtils.fromUTF8Bytes(pingJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -257,7 +257,7 @@ public class Boot extends Thread { GearmanJobResult pingJobRes = pingJobWoL.get(); String result = ByteUtils.fromUTF8Bytes(pingJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -315,7 +315,7 @@ public class Boot extends Thread { String result = ByteUtils.fromUTF8Bytes(osJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -370,7 +370,7 @@ public class Boot extends Thread { String result = ByteUtils.fromUTF8Bytes(whoJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -385,13 +385,15 @@ public class Boot extends Thread { if (user.isEmpty()) { System.out.println(ipAddress - + " right User"); - status.put(clientID, 13); // right user + + " no user is logged in"); + // no user is logged in + status.put(clientID, 13); whoJobs.remove(clientID); } else { System.out.println(ipAddress - + " wrong User"); - status.put(clientID, 11); // wrong user + + " a user is logged in"); + // a user is logged in + status.put(clientID, 11); whoJobs.remove(clientID); } } else { @@ -431,7 +433,7 @@ public class Boot extends Thread { String result = ByteUtils.fromUTF8Bytes(whoJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -481,7 +483,7 @@ public class Boot extends Thread { GearmanJobResult wolJobRes = restartJob.get(); String result = ByteUtils.fromUTF8Bytes(wolJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -537,7 +539,7 @@ public class Boot extends Thread { String result = ByteUtils .fromUTF8Bytes(pingJobRestartRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { diff --git a/gearman/controllerWorker/ControllerWorker/Shutdown.java b/gearman/controllerWorker/ControllerWorker/Shutdown.java index 2558d64..9961ff7 100644 --- a/gearman/controllerWorker/ControllerWorker/Shutdown.java +++ b/gearman/controllerWorker/ControllerWorker/Shutdown.java @@ -125,7 +125,7 @@ public class Shutdown extends Thread { String result = ByteUtils.fromUTF8Bytes(pingJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -177,7 +177,7 @@ public class Shutdown extends Thread { String result = ByteUtils.fromUTF8Bytes(whoJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -192,13 +192,15 @@ public class Shutdown extends Thread { if (user.isEmpty()) { System.out.println(ipAddress - + " right User"); - status.put(clientID, 4); // right user + + " no user is logged in"); + // no user is logged in + status.put(clientID, 4); whoJobs.remove(clientID); } else { System.out.println(ipAddress - + " wrong User"); - status.put(clientID, 9); // wrong user + + " a user is logged in"); + // a user is logged in + status.put(clientID, 9); whoJobs.remove(clientID); } } else { @@ -236,7 +238,7 @@ public class Shutdown extends Thread { GearmanJobResult wolJobRes = shutdownJob.get(); String result = ByteUtils.fromUTF8Bytes(wolJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -291,7 +293,7 @@ public class Shutdown extends Thread { GearmanJobResult pingJobRes = pingJobShutdown.get(); String result = ByteUtils.fromUTF8Bytes(pingJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { @@ -355,7 +357,7 @@ public class Shutdown extends Thread { String result = ByteUtils.fromUTF8Bytes(whoJobRes .getResults()); - if (result != "") { + if (!result.isEmpty()) { JSONObject resultObj = (JSONObject) JSONValue .parse(result); if (!resultObj.containsKey("err")) { -- cgit v1.2.3-55-g7522