Excluded jackson core libraries from Mockserver and moved cache config
to the full config.
Change-Id: Ia62a78377450e3cc5b9f2687e28c1a9417feed9d
diff --git a/core/Changes b/core/Changes
index 7a01bcb..ab04e26 100644
--- a/core/Changes
+++ b/core/Changes
@@ -10,6 +10,7 @@
2021-07-26
- Replaced annotation parsing with restoring the annotation tables to the
database.
+ - Moved cache config to the full config.
# version 0.63
14/01/2021
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 2043bca..95c7843 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -16,17 +16,10 @@
import java.util.Set;
import java.util.regex.Pattern;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-import de.ids_mannheim.korap.encryption.RandomCodeGenerator;
import de.ids_mannheim.korap.util.KrillProperties;
import de.ids_mannheim.korap.utils.TimeUtils;
import lombok.Getter;
import lombok.Setter;
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.config.CacheConfiguration;
/**
* Describes configuration for Kustvakt by importing properties
@@ -44,8 +37,6 @@
@Getter
public class KustvaktConfiguration {
- private Logger log = LogManager.getLogger(KustvaktConfiguration.class);
-
public static final Map<String, Object> KUSTVAKT_USER = new HashMap<>();
private String vcInCaching;
@@ -115,7 +106,7 @@
// another variable might be needed to define which metadata fields are restricted
private boolean isMetadataRestricted = false;
- // EM: Maybe needed we support pipe registration
+ // EM: Maybe needed when we support pipe registration
@Deprecated
public static Map<String, String> pipes = new HashMap<>();
@@ -212,13 +203,6 @@
properties.getProperty("security.tokenTTL", "72H"));
shortTokenTTL = TimeUtils.convertTimeToSeconds(
properties.getProperty("security.shortTokenTTL", "3H"));
-
- Cache cache = CacheManager.newInstance().getCache("named_vc");
- CacheConfiguration config = cache.getCacheConfiguration();
- config.setMaxBytesLocalHeap(properties.getProperty("cache.max.bytes.local.heap", "256m"));
- config.setMaxBytesLocalDisk(properties.getProperty("cache.max.bytes.local.disk", "2G"));
- log.info("max local heap:"+config.getMaxBytesLocalHeapAsString());
- log.info("max local disk:"+config.getMaxBytesLocalDiskAsString());
}
@Deprecated
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java b/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
index 6da8f2a..969d4b6 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/FullConfiguration.java
@@ -18,6 +18,9 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.jwk.JWK;
import com.nimbusds.jose.jwk.JWKSet;
@@ -28,6 +31,9 @@
import de.ids_mannheim.korap.interfaces.EncryptionIface;
import de.ids_mannheim.korap.oauth2.openid.OpenIdConfiguration;
import de.ids_mannheim.korap.utils.TimeUtils;
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.config.CacheConfiguration;
/**
* Configuration for Kustvakt full version including properties
@@ -38,6 +44,7 @@
*/
public class FullConfiguration extends KustvaktConfiguration {
+ public static Logger jlog = LogManager.getLogger(FullConfiguration.class);
// mail configuration
private boolean isMailEnabled;
private String testEmail;
@@ -112,6 +119,14 @@
setRSAKeys(properties);
setNamedVCPath(properties.getProperty("krill.namedVC", ""));
+
+ Cache cache = CacheManager.newInstance().getCache("named_vc");
+ CacheConfiguration config = cache.getCacheConfiguration();
+ config.setMaxBytesLocalHeap(properties.getProperty("cache.max.bytes.local.heap", "256m"));
+ config.setMaxBytesLocalDisk(properties.getProperty("cache.max.bytes.local.disk", "2G"));
+ jlog.info("max local heap:"+config.getMaxBytesLocalHeapAsString());
+ jlog.info("max local disk:"+config.getMaxBytesLocalDiskAsString());
+
}
private void setSecurityConfiguration (Properties properties) {
diff --git a/lite/Changes b/lite/Changes
index 1901ff7..dc10e4d 100644
--- a/lite/Changes
+++ b/lite/Changes
@@ -12,6 +12,7 @@
2021-07-26
- Replaced annotation parsing with restoring the annotation tables to the
database.
+ - Excluded jackson core libraries from Mockserver.
# version 0.62.4
24/01/2020
diff --git a/lite/pom.xml b/lite/pom.xml
index bb0743f..693e203 100644
--- a/lite/pom.xml
+++ b/lite/pom.xml
@@ -209,13 +209,26 @@
<artifactId>backport-util-concurrent</artifactId>
<version>3.1</version>
</dependency>
-
- <!-- Mockserver -->
+ <!-- Mockserver -->
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
<version>5.11.2</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
</project>