Class CompletedPublicationsCache

java.lang.Object
org.eclipse.pass.loader.nihms.CompletedPublicationsCache

public class CompletedPublicationsCache extends Object
This controls a simple local text file containing a list of compliant "pmid|grantNumber" combinations that are considered DONE and therefore require no re-processing. Only compliant records with a PMCID already assigned should be added to this list. The list is used as a lookup during processing to avoid the excessive database interactions that are required to re-process completed nihms data.
Author:
Karen Hanson
  • Method Details

    • getInstance

      public static CompletedPublicationsCache getInstance()
      Get singleton instance of cache
      Returns:
      the singleton instance
    • add

      public void add(String pmid, String awardNumber)
      Add pmid/awardNumber combination to set
      Parameters:
      pmid - pub med id
      awardNumber - award number
    • contains

      public boolean contains(String pmid, String awardNumber)
      Check if it contains pmid/award number combination
      Parameters:
      pmid - pub med id
      awardNumber - award number
      Returns:
      true if the id/award number combo is cached
    • size

      public int size()
      Get number of items in cache
      Returns:
      the size of the cache
    • clear

      public void clear()
      Empty cache
    • loadFromFile

      public void loadFromFile()
      Load contents of cache file into memory from file