Class UserPubSubmissionsCache

java.lang.Object
org.eclipse.pass.loader.nihms.client.cache.UserPubSubmissionsCache

public class UserPubSubmissionsCache extends Object
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 Details

    • getInstance

      public static UserPubSubmissionsCache getInstance()
      Get singleton instance of UserPubSubmissionsCache
      Returns:
      the UserPubSubmissions ID cache
    • addToOrCreateEntry

      public void addToOrCreateEntry(String userIdPubId, String submissionId)
      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 id
      submissionId - the submission id
    • put

      public void put(String userIdPubId, Set<String> submissionIds)
      Add userIdPubId/submissionIds combination to map
      Parameters:
      userIdPubId - the concatenated user id and publication id
      submissionIds - the submission ids
    • get

      public Set<String> get(String userIdPubId)
      Retrieve submissionIds by userIdPubId
      Parameters:
      userIdPubId - the concatenated user id and publication id
      Returns:
      submission ids
    • remove

      public void remove(String userIdPubId)
      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