Class NihmsRepositoryCopyIdCache

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

public class NihmsRepositoryCopyIdCache extends Object
Caches publicationId and repositoryCopyId mapping for easy lookup Important: includes RepositoryCopies for NIHMS records only
Author:
Karen Hanson
  • Method Details

    • getInstance

      public static NihmsRepositoryCopyIdCache getInstance()
      Get singleton instance of NihmsRepositoryCopyIdCache
      Returns:
      the RepositoryCopy ID cache
    • put

      public void put(String publicationId, String repositoryCopyId)
      Add publicationId to repositoryCopyId mapping
      Parameters:
      publicationId - the publication id
      repositoryCopyId - the repository copy it
    • get

      public String get(String publicationId)
      Retrieve RepositoryCopyId by publicationId
      Parameters:
      publicationId - the publication id
      Returns:
      the repository copy id
    • remove

      public void remove(String publicationId)
      Remove a publicationId to repositoryCopyId mapping from cache
      Parameters:
      publicationId - the publication id
    • size

      public int size()
      Get number of cached mappings
      Returns:
      the cache size
    • clear

      public void clear()
      Empty map