diff options
author | Instrumental <jonathan.gathman@att.com> | 2019-10-15 11:38:13 -0500 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2019-10-15 11:49:39 -0500 |
commit | bc5f9dec37da59182034c1166a6a9d4150f40847 (patch) | |
tree | 30a1d54d159f70bcd37182f38ad3ce3d425888e7 | |
parent | 0598a034592fdfb0bf7a971066f325e7b6594994 (diff) |
Sonar Warning
Issue-ID: AAF-1019
Change-Id: I21392732189837f6ce031d618bd8f5e63e06e28c
Signed-off-by: Instrumental <jonathan.gathman@att.com>
-rw-r--r-- | auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java | 2 | ||||
-rw-r--r-- | auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java index 9c55d464..b1165c26 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedCredDAO.java @@ -38,7 +38,7 @@ public class CachedCredDAO extends CachedDAO<AuthzTrans, CredDAO, CredDAO.Data> public CachedCredDAO(CredDAO dao, CIDAO<AuthzTrans> info, long expiresIn) { super(dao, info, CredDAO.CACHE_SEG, expiresIn); - if(FileGetter.isLoaded) { + if(FileGetter.isLoaded()) { readID = new ReadID() { @Override public Result<List<Data>> read(AuthzTrans trans, final String id) { diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java index 702f989a..75efdfae 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/FileGetter.java @@ -43,9 +43,9 @@ import org.onap.aaf.cadi.util.CSV; public class FileGetter { private static final String AAF_FILEGETTER = "aaf_filegetter"; - public static boolean isLoaded = false; + private static boolean isLoaded = false; private static FileGetter singleton; - + private static List<CredDAO.Data> EMPTY = new ArrayList<>(); private Map<String,List<CredDAO.Data>> data; private SimpleDateFormat sdf; private FileGetter(Access access) { @@ -110,12 +110,12 @@ public class FileGetter { singleton = new FileGetter(access); } return singleton; - } + public Getter<CredDAO.Data> getter(String id) { return new FGetter(id); } - private static List<CredDAO.Data> EMPTY = new ArrayList<>(); + public class FGetter implements Getter<CredDAO.Data> { private final List<CredDAO.Data> lcdd; public FGetter(final String id) { @@ -142,5 +142,9 @@ public class FileGetter { } } } + + public static boolean isLoaded() { + return isLoaded; + } } |