JAL-1999 JAL-1479 implemented configurable fail-safe mechanism for SIFTS mapping...
[jalview.git] / src / jalview / ws / sifts / SiftsSettings.java
index 5554658..e1e3de8 100644 (file)
@@ -1,11 +1,17 @@
 package jalview.ws.sifts;
 
+import java.util.Objects;
+
 public class SiftsSettings
 {
   private static boolean mapWithSifts = false;
 
   private static String siftDownloadDirectory;
 
+  private static int cacheThresholdInDays;
+
+  private static int failSafePIDThreshold;
+
   public static boolean isMapWithSifts()
   {
     return mapWithSifts;
@@ -25,4 +31,28 @@ public class SiftsSettings
   {
     SiftsSettings.siftDownloadDirectory = siftDownloadDirectory;
   }
+
+  public static int getCacheThresholdInDays()
+  {
+    return cacheThresholdInDays;
+  }
+
+  public static void setCacheThresholdInDays(String cacheThresholdInDays)
+  {
+    Objects.requireNonNull(cacheThresholdInDays);
+    SiftsSettings.cacheThresholdInDays = Integer
+            .valueOf(cacheThresholdInDays);
+  }
+
+  public static int getFailSafePIDThreshold()
+  {
+    return failSafePIDThreshold;
+  }
+
+  public static void setFailSafePIDThreshold(String failSafePIDThreshold)
+  {
+    Objects.requireNonNull(failSafePIDThreshold);
+    SiftsSettings.failSafePIDThreshold = Integer
+            .valueOf(failSafePIDThreshold);
+  }
 }