diff --git a/src/main/java/org/folio/edge/patron/cache/PatronIdCache.java b/src/main/java/org/folio/edge/patron/cache/PatronIdCache.java index 465da42..13bc25a 100644 --- a/src/main/java/org/folio/edge/patron/cache/PatronIdCache.java +++ b/src/main/java/org/folio/edge/patron/cache/PatronIdCache.java @@ -26,16 +26,16 @@ private PatronIdCache(long ttl, long nullTokenTtl, int capacity) { } /** - * Get the PatronIdCache singleton. the singleton must be initialize before + * Get the PatronIdCache singleton. the singleton must be initialized before * calling this method. * - * @see {@link #initialize(long, int)} + * @see {@link #initialize(long, long, int)} * * @return the PatronIdCache singleton instance. */ public static synchronized PatronIdCache getInstance() { if (instance == null) { - throw new NotInitializedException( + throw new PatronIdCacheNotInitializedException( "You must call PatronIdCache.initialize(ttl, capacity) before you can get the singleton instance"); } return instance; @@ -71,11 +71,11 @@ private String computeKey(String tenant, String externalId) { return String.format("%s:%s", tenant, externalId); } - public static class NotInitializedException extends RuntimeException { + public static class PatronIdCacheNotInitializedException extends RuntimeException { private static final long serialVersionUID = 4747532964596334577L; - public NotInitializedException(String msg) { + public PatronIdCacheNotInitializedException(String msg) { super(msg); } } diff --git a/src/main/java/org/folio/edge/patron/utils/PatronIdHelper.java b/src/main/java/org/folio/edge/patron/utils/PatronIdHelper.java index 3193fde..4419665 100644 --- a/src/main/java/org/folio/edge/patron/utils/PatronIdHelper.java +++ b/src/main/java/org/folio/edge/patron/utils/PatronIdHelper.java @@ -3,7 +3,6 @@ import io.vertx.core.Future; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.folio.edge.core.cache.TokenCache.NotInitializedException; import org.folio.edge.patron.cache.PatronIdCache; public class PatronIdHelper { @@ -19,7 +18,7 @@ public static Future lookupPatron(PatronOkapiClient client, String tenan try { PatronIdCache cache = PatronIdCache.getInstance(); patronId = cache.get(tenant, extPatronId); - } catch (NotInitializedException e) { + } catch (PatronIdCache.PatronIdCacheNotInitializedException e) { logger.warn("Failed to access PatronIdCache", e); }