+
+ public void verify(String hash) throws GigiApiException {
+ try {
+ PreparedStatement ps = DatabaseConnection.getInstance().prepare("UPDATE domainPinglog SET state='success' WHERE challenge=? AND configId IN (SELECT id FROM pingconfig WHERE domainId=?)");
+ ps.setString(1, hash);
+ ps.setInt(2, id);
+ ps.executeUpdate();
+ } catch (SQLException e) {
+ throw new GigiApiException(e);
+ }
+ }
+
+ public boolean isVerified() {
+ try {
+ PreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT 1 FROM domainPinglog INNER JOIN pingconfig ON pingconfig.id=domainPinglog.configId WHERE domainid=? AND state='success'");
+ ps.setInt(1, id);
+ ResultSet rs = ps.executeQuery();
+ return rs.next();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }