]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/ping/PingerDaemon.java
refactor: move two dbObjects-inner classes to their own types.
[gigi.git] / src / org / cacert / gigi / ping / PingerDaemon.java
index bc86d80c7b09de993e945870a90786326e5887c7..b76035f2d5d217c23cd8dae81da3b43df54e75a6 100644 (file)
@@ -10,12 +10,12 @@ import org.cacert.gigi.database.GigiPreparedStatement;
 import org.cacert.gigi.database.GigiResultSet;
 import org.cacert.gigi.dbObjects.Domain;
 import org.cacert.gigi.dbObjects.DomainPingConfiguration;
-import org.cacert.gigi.dbObjects.DomainPingConfiguration.PingType;
+import org.cacert.gigi.dbObjects.DomainPingType;
 import org.cacert.gigi.util.RandomToken;
 
 public class PingerDaemon extends Thread {
 
-    HashMap<PingType, DomainPinger> pingers = new HashMap<>();
+    HashMap<DomainPingType, DomainPinger> pingers = new HashMap<>();
 
     private GigiPreparedStatement searchNeededPings;
 
@@ -30,10 +30,10 @@ public class PingerDaemon extends Thread {
     @Override
     public void run() {
         searchNeededPings = DatabaseConnection.getInstance().prepare("SELECT `pingconfig`.`id` FROM `pingconfig` LEFT JOIN `domainPinglog` ON `domainPinglog`.`configId` = `pingconfig`.`id` INNER JOIN `domains` ON `domains`.`id` = `pingconfig`.`domainid` WHERE ( `domainPinglog`.`configId` IS NULL) AND `domains`.`deleted` IS NULL GROUP BY `pingconfig`.`id`");
-        pingers.put(PingType.EMAIL, new EmailPinger());
-        pingers.put(PingType.SSL, new SSLPinger(truststore));
-        pingers.put(PingType.HTTP, new HTTPFetch());
-        pingers.put(PingType.DNS, new DNSPinger());
+        pingers.put(DomainPingType.EMAIL, new EmailPinger());
+        pingers.put(DomainPingType.SSL, new SSLPinger(truststore));
+        pingers.put(DomainPingType.HTTP, new HTTPFetch());
+        pingers.put(DomainPingType.DNS, new DNSPinger());
 
         while (true) {
             try {
@@ -66,7 +66,7 @@ public class PingerDaemon extends Thread {
     }
 
     private void handle(DomainPingConfiguration conf) {
-        PingType type = conf.getType();
+        DomainPingType type = conf.getType();
         String config = conf.getInfo();
         DomainPinger dp = pingers.get(type);
         if (dp != null) {