Lombok for noCacheing and CacheErrors
This commit is contained in:
parent
06cbe7245c
commit
6e6184a425
|
@ -40,6 +40,7 @@ import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hl7.fhir.exceptions.FHIRException;
|
import org.hl7.fhir.exceptions.FHIRException;
|
||||||
import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult;
|
import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult;
|
||||||
|
@ -121,12 +122,15 @@ public class TerminologyCache {
|
||||||
private Object lock;
|
private Object lock;
|
||||||
private String folder;
|
private String folder;
|
||||||
private Map<String, NamedCache> caches = new HashMap<String, NamedCache>();
|
private Map<String, NamedCache> caches = new HashMap<String, NamedCache>();
|
||||||
|
@Getter @Setter
|
||||||
private static boolean noCaching;
|
private static boolean noCaching;
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
private static boolean cacheErrors;
|
private static boolean cacheErrors;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
String cacheErrorsProperty = System.getProperty("fhir.txcache.cacheErrors");
|
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
|
// use lock from the context
|
||||||
|
@ -553,14 +557,6 @@ public class TerminologyCache {
|
||||||
return b.toString();
|
return b.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNoCaching() {
|
|
||||||
return noCaching;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setNoCaching(boolean noCaching) {
|
|
||||||
TerminologyCache.noCaching = noCaching;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeCS(String url) {
|
public void removeCS(String url) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
String name = getNameForSystem(url);
|
String name = getNameForSystem(url);
|
||||||
|
|
Loading…
Reference in New Issue