From f0dfe40b169cb83c27da09cddb146f2714f71ab7 Mon Sep 17 00:00:00 2001 From: Jim Martino Date: Thu, 16 Nov 2017 09:35:52 -0500 Subject: [PATCH] clarify behavior of using maxRetryAttempts clean up definition of default idStoreFile value some format improvement --- .../core/idservice/HttpArkIdService.java | 16 +++++++++------- .../main/resources/http-arkidservice.properties | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/info/rmapproject/core/idservice/HttpArkIdService.java b/core/src/main/java/info/rmapproject/core/idservice/HttpArkIdService.java index 0fbd289c..bbf26843 100644 --- a/core/src/main/java/info/rmapproject/core/idservice/HttpArkIdService.java +++ b/core/src/main/java/info/rmapproject/core/idservice/HttpArkIdService.java @@ -40,8 +40,8 @@ public class HttpArkIdService implements IdService { /** The ID prefix to be added. */ private String idPrefix = ""; - /** Set a maximum retry attempts value if you want to cap the property setting. -1 means no maximum */ - private int maxRetryAttempts = -1; + /** Set a maximum retry attempts value */ + private int maxRetryAttempts = 5; /** User name if using Basic Auth. */ private String userName = ""; @@ -55,16 +55,18 @@ public class HttpArkIdService implements IdService { /** String regex to validate an ID against. */ private String idRegex = ""; - /**Default file for persistent reserved ID storage - * Should be overridden in the rmap.properties file (idservice.idStoreFile), - * default is included here as a failsafe - * **/ - private String idStoreFile = System.getProperty("java.io.tmpdir") + File.pathSeparatorChar + "EZID.cache"; + /** File for persistent ID cache storage */ + private String idStoreFile; + /** the string name for the cache map **/ private static final String DATA = "ezidData"; + /** the MVMap for storing the reserved EZIDs **/ private MVMap ezids; + + /** the maximum number of IDs we would like to have on hand */ private int maxStoreSize=200; + /** indicates whether we have a process running which is replenishing the cache **/ private boolean replenishingCache = false; diff --git a/core/src/main/resources/http-arkidservice.properties b/core/src/main/resources/http-arkidservice.properties index 13ff25ad..c79620b0 100644 --- a/core/src/main/resources/http-arkidservice.properties +++ b/core/src/main/resources/http-arkidservice.properties @@ -28,5 +28,5 @@ idservice.userName=apitest idservice.userPassword=apitest idservice.idLength=21 idservice.idRegex=ark:\\/\\d{5}\\/[a-z0-9]{10} -idservice.idStoreFile=/tmp/idStoreFile +idservice.idStoreFile=${java.io.tmpdir}/idStoreFile idservice.maxStoreSize=200 \ No newline at end of file