]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/DomainPingConfiguration.java
add: show support and user the account history and the trainings.
[gigi.git] / src / org / cacert / gigi / dbObjects / DomainPingConfiguration.java
index c6d053af05136d8b22489b116cd76baf881e9fee..145473fdb9a871c892f8f42ad87caa89a9c4ee5d 100644 (file)
@@ -15,20 +15,16 @@ import org.cacert.gigi.output.template.SprintfCommand;
 
 public class DomainPingConfiguration implements IdCachable {
 
-    public static enum PingType {
-        EMAIL, DNS, HTTP, SSL;
-    }
-
     private int id;
 
     private Domain target;
 
-    private PingType type;
+    private DomainPingType type;
 
     private String info;
 
     private DomainPingConfiguration(int id) {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT id, domainid, type, info FROM pingconfig WHERE id=?");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `id`, `domainid`, `type`, `info` FROM `pingconfig` WHERE `id`=?");
         ps.setInt(1, id);
 
         GigiResultSet rs = ps.executeQuery();
@@ -37,7 +33,7 @@ public class DomainPingConfiguration implements IdCachable {
         }
         this.id = rs.getInt("id");
         target = Domain.getById(rs.getInt("domainid"));
-        type = PingType.valueOf(rs.getString("type").toUpperCase());
+        type = DomainPingType.valueOf(rs.getString("type").toUpperCase());
         info = rs.getString("info");
     }
 
@@ -50,7 +46,7 @@ public class DomainPingConfiguration implements IdCachable {
         return target;
     }
 
-    public PingType getType() {
+    public DomainPingType getType() {
         return type;
     }
 
@@ -69,7 +65,7 @@ public class DomainPingConfiguration implements IdCachable {
     }
 
     public Date getLastExecution() {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from domainPinglog WHERE configId=? ORDER BY `when` DESC LIMIT 1");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from `domainPinglog` WHERE `configId`=? ORDER BY `when` DESC LIMIT 1");
         ps.setInt(1, id);
         GigiResultSet rs = ps.executeQuery();
         if (rs.next()) {
@@ -79,7 +75,7 @@ public class DomainPingConfiguration implements IdCachable {
     }
 
     public Date getLastSuccess() {
-        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from domainPinglog WHERE configId=? AND state='success' ORDER BY `when` DESC LIMIT 1");
+        GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT `when` AS stamp from `domainPinglog` WHERE `configId`=? AND state='success' ORDER BY `when` DESC LIMIT 1");
         ps.setInt(1, id);
         GigiResultSet rs = ps.executeQuery();
         if (rs.next()) {