Package org.eclipse.pass.loader.nihms
Class CompletedPublicationsCache
java.lang.Object
org.eclipse.pass.loader.nihms.CompletedPublicationsCache
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 Summary
Modifier and TypeMethodDescriptionvoidAdd pmid/awardNumber combination to setvoidclear()Empty cachebooleanCheck if it contains pmid/award number combinationstatic CompletedPublicationsCacheGet singleton instance of cachevoidLoad contents of cache file into memory from fileintsize()Get number of items in cache
-
Method Details
-
getInstance
Get singleton instance of cache- Returns:
- the singleton instance
-
add
Add pmid/awardNumber combination to set- Parameters:
pmid- pub med idawardNumber- award number
-
contains
Check if it contains pmid/award number combination- Parameters:
pmid- pub med idawardNumber- 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
-