Updated cache settings and some loggings.

Change-Id: I76c00ef1a40bd8fcb2232eb1a442be10e8fba9bd
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 eba39a5..2043bca 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,10 +16,17 @@
 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 
@@ -37,6 +44,8 @@
 @Getter
 public class KustvaktConfiguration {
 
+	private Logger log = LogManager.getLogger(KustvaktConfiguration.class);
+	
     public static final Map<String, Object> KUSTVAKT_USER = new HashMap<>();
 
     private String vcInCaching;
@@ -203,6 +212,13 @@
                 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/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java b/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
index ea67bd6..bf8cca1 100644
--- a/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
+++ b/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
@@ -13,6 +13,8 @@
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -39,6 +41,8 @@
                     "h", "m", "n", "p", "r", "t", "F", "G", "H", "J", "L", "M",
                     "N", "P", "R", "T" });
 
+    private Logger log = LogManager.getLogger(RandomCodeGenerator.class);
+    
     @Autowired
     public KustvaktConfiguration config;
 
@@ -53,7 +57,7 @@
         else {
             secureRandom = new SecureRandom();
         }
-        System.out.println(
+        log.info(
                 "Secure random algorithm: " + secureRandom.getAlgorithm());
     }
 
diff --git a/full/Changes b/full/Changes
index 9f8e800..3764dd4 100644
--- a/full/Changes
+++ b/full/Changes
@@ -2,6 +2,10 @@
 2021-06-11
  - Updated OAuth2 token length & secure random algorithm config.
  - Added character set filter to random code generator, e.g. for client_id.
+2021-06-14
+ - Updated roleId and super client parameters.
+2021-06-24
+ - Fixed broken test. 
  
 # version 0.63.1
 2021-02-22
@@ -11,10 +15,11 @@
  - Added query access roles and fixed vc access roles (margaretha)
  - Added delete query webservice and tests (margaretha) 
 2021-03-25
+ - Updated Koral version for Info Controller (margaretha)
  - Updated OAuth2 token list with token type and user clientId 
    parameters (margaretha) 
 2021-03-29
- - Added client type in the client list web-service (margaretha)  
+ - Added client type in the client list web-service. Resolved #58 (margaretha)  
 2021-04-19
  - Updated OAuth2Client JSON definition and controller tests (margaretha)
 2021-04-26
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
index 4e90699..cd5ab0a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/QueryReferenceController.java
@@ -149,7 +149,7 @@
     
     @DELETE
     @Path("~{createdBy}/{qName}")
-    public Response deleteVCByName (@Context SecurityContext securityContext,
+    public Response deleteQueryByName (@Context SecurityContext securityContext,
             @PathParam("createdBy") String createdBy,
             @PathParam("qName") String qName) {
         TokenContext context =
diff --git a/full/src/main/resources/ehcache.xml b/full/src/main/resources/ehcache.xml
index 2801a59..61b675f 100644
--- a/full/src/main/resources/ehcache.xml
+++ b/full/src/main/resources/ehcache.xml
@@ -56,7 +56,7 @@
 		eternal="true" 
 		memoryStoreEvictionPolicy="LRU"
 		maxBytesLocalHeap="256M" 
-		maxBytesLocalDisk="1G"
+		maxBytesLocalDisk="2G"
 		diskExpiryThreadIntervalSeconds = "120" > 
 		<persistence strategy="localTempSwap"/>
 		<sizeOfPolicy maxDepth="3000" maxDepthExceededBehavior="abort" />