Lombok for noCacheing and CacheErrors

This commit is contained in:
dotasek 2022-01-06 19:35:19 -05:00
parent 06cbe7245c
commit 6e6184a425
1 changed files with 5 additions and 9 deletions

View File

@ -40,6 +40,7 @@ import java.util.*;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult;
@ -121,12 +122,15 @@ public class TerminologyCache {
private Object lock;
private String folder;
private Map<String, NamedCache> caches = new HashMap<String, NamedCache>();
@Getter @Setter
private static boolean noCaching;
@Getter @Setter
private static boolean cacheErrors;
static {
String cacheErrorsProperty = System.getProperty("fhir.txcache.cacheErrors");
cacheErrors = cacheErrorsProperty != null && "TRUE".equals(cacheErrorsProperty.toUpperCase(Locale.ROOT));
setCacheErrors(cacheErrorsProperty != null && "TRUE".equals(cacheErrorsProperty.toUpperCase(Locale.ROOT)));
}
// use lock from the context
@ -553,14 +557,6 @@ public class TerminologyCache {
return b.toString();
}
public static boolean isNoCaching() {
return noCaching;
}
public static void setNoCaching(boolean noCaching) {
TerminologyCache.noCaching = noCaching;
}
public void removeCS(String url) {
synchronized (lock) {
String name = getNameForSystem(url);