]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/Domain.java
upd: the world changed to need our test vectors for public suffix list
[gigi.git] / src / org / cacert / gigi / dbObjects / Domain.java
index 9df2e4822c7f33eae8cc8f1003011e8a44078c4e..7e35225f4d99d409cee53e9aec64544c8563df9a 100644 (file)
@@ -18,7 +18,7 @@ import org.cacert.gigi.database.GigiResultSet;
 import org.cacert.gigi.dbObjects.DomainPingConfiguration.PingType;
 import org.cacert.gigi.util.PublicSuffixes;
 
-public class Domain implements IdCachable {
+public class Domain implements IdCachable, Verifyable {
 
     public class DomainPingExecution {
 
@@ -69,6 +69,7 @@ public class Domain implements IdCachable {
     private int id;
 
     private static final Set<String> IDNEnabledTLDs;
+
     static {
         Properties CPS = new Properties();
         try (InputStream resourceAsStream = Domain.class.getResourceAsStream("CPS.properties")) {
@@ -233,7 +234,7 @@ public class Domain implements IdCachable {
         configs = null;
     }
 
-    public void verify(String hash) throws GigiApiException {
+    public synchronized void verify(String hash) throws GigiApiException {
         GigiPreparedStatement 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);
@@ -261,7 +262,7 @@ public class Domain implements IdCachable {
 
     }
 
-    private static ObjectCache<Domain> myCache = new ObjectCache<>();
+    private static final ObjectCache<Domain> myCache = new ObjectCache<>();
 
     public static synchronized Domain getById(int id) throws IllegalArgumentException {
         Domain em = myCache.get(id);