Class UserPubSubmissionsCache
java.lang.Object
org.eclipse.pass.loader.nihms.client.cache.UserPubSubmissionsCache
Caches userIdPubId as concatenated string with the list of submissions relevant to that combination to ensure
all relevant submissions are retrieved regardless of whether index is up to date with most recent etl records
- Author:
- Karen Hanson
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToOrCreateEntry(String userIdPubId, String submissionId) Add an item to an existing Map Entry or create a new one if one does not already existvoidclear()Empty mapRetrieve submissionIds by userIdPubIdstatic UserPubSubmissionsCacheGet singleton instance of UserPubSubmissionsCachevoidAdd userIdPubId/submissionIds combination to mapvoidRemove a Submission from cacheintsize()Get number of cached submissions
-
Method Details
-
getInstance
Get singleton instance of UserPubSubmissionsCache- Returns:
- the UserPubSubmissions ID cache
-
addToOrCreateEntry
Add an item to an existing Map Entry or create a new one if one does not already exist- Parameters:
userIdPubId- the concatenated user id and publication idsubmissionId- the submission id
-
put
Add userIdPubId/submissionIds combination to map- Parameters:
userIdPubId- the concatenated user id and publication idsubmissionIds- the submission ids
-
get
Retrieve submissionIds by userIdPubId- Parameters:
userIdPubId- the concatenated user id and publication id- Returns:
- submission ids
-
remove
Remove a Submission from cache- Parameters:
userIdPubId- the concatenated user id and publication id
-
size
public int size()Get number of cached submissions- Returns:
- the size of the cache
-
clear
public void clear()Empty map
-