Class MCROAISearcher

java.lang.Object
org.mycore.oai.MCROAISearcher
Direct Known Subclasses:
MCROAICombinedSearcher, MCROAIDeletedSearcher, MCROAISolrSearcher

public abstract class MCROAISearcher extends Object

Base class to query different types of data in the mycore system. Implementations has to implement the query and the earliest time stamp methods. The result of a query is a MCROAIResult.

Searchers have a unique id and a expiration time which increases every time a query is fired.

Author:
Matthias Eichner
  • Field Details

    • LOGGER

      protected static final Logger LOGGER
    • identify

      protected MCROAIIdentify identify
    • metadataFormat

      protected org.mycore.oai.pmh.MetadataFormat metadataFormat
    • id

      protected final String id
      The unique ID of this result set
    • expire

      protected long expire
    • runningExpirationTimer

      protected long runningExpirationTimer
      Increase every time a query(String) is called
    • partitionSize

      protected int partitionSize
    • setManager

      protected MCROAISetManager setManager
  • Constructor Details

    • MCROAISearcher

      public MCROAISearcher()
  • Method Details

    • init

      public void init(MCROAIIdentify identify, org.mycore.oai.pmh.MetadataFormat format, long expire, int partitionSize, MCROAISetManager setManager, MCROAIObjectManager objectManager)
    • getHeader

      public abstract Optional<org.mycore.oai.pmh.Header> getHeader(String mcrId)
    • query

      public abstract MCROAIResult query(String cursor)
    • query

      public abstract MCROAIResult query(MCRSet set, Instant from, Instant until)
    • getEarliestTimestamp

      public abstract Optional<Instant> getEarliestTimestamp()
      Returns the earliest created/modified record time stamp. If the earliest time stamp cannot be retrieved an empty optional is returned.
      Returns:
      the earliest created/modified time stamp
    • isExpired

      public boolean isExpired()
    • getExpirationTime

      public Instant getExpirationTime()
    • getMetadataFormat

      public org.mycore.oai.pmh.MetadataFormat getMetadataFormat()
    • getID

      public String getID()
    • getSetManager

      public MCROAISetManager getSetManager()
    • getObjectManager

      public MCROAIObjectManager getObjectManager()
    • getConfigPrefix

      protected String getConfigPrefix()
    • updateRunningExpirationTimer

      protected void updateRunningExpirationTimer()
      Updates the running expiration timer.
    • getPartitionSize

      public int getPartitionSize()