Class MCROAISearchManager

java.lang.Object
org.mycore.oai.MCROAISearchManager

public class MCROAISearchManager extends Object
Search manager of the mycore OAI-PMH implementation. Creates a new MCROAISearcher instance for each searchHeader(MetadataFormat, MCRSet, Instant, Instant) and searchRecord(MetadataFormat, MCRSet, Instant, Instant) call. The resumption token created by those methods can be reused for later calls to the same searcher. A searcher is dropped after an expiration time. The time increases for each query call.

Due to token based querying it is not possible to set a current position for the resumption token. Its always set to -1.

Author:
Matthias Eichner
  • Field Details

  • Constructor Details

    • MCROAISearchManager

      public MCROAISearchManager()
  • Method Details

    • init

      public void init(MCROAIIdentify identify, MCROAIObjectManager objManager, MCROAISetManager setManager, int partitionSize)
    • getHeader

      public Optional<org.mycore.oai.pmh.Header> getHeader(String oaiId)
    • searchHeader

      public org.mycore.oai.pmh.OAIDataList<org.mycore.oai.pmh.Header> searchHeader(String resumptionToken) throws org.mycore.oai.pmh.BadResumptionTokenException
      Throws:
      org.mycore.oai.pmh.BadResumptionTokenException
    • searchRecord

      public org.mycore.oai.pmh.OAIDataList<org.mycore.oai.pmh.Record> searchRecord(String resumptionToken) throws org.mycore.oai.pmh.BadResumptionTokenException
      Throws:
      org.mycore.oai.pmh.BadResumptionTokenException
    • searchHeader

      public org.mycore.oai.pmh.OAIDataList<org.mycore.oai.pmh.Header> searchHeader(org.mycore.oai.pmh.MetadataFormat format, MCRSet set, Instant from, Instant until)
    • searchRecord

      public org.mycore.oai.pmh.OAIDataList<org.mycore.oai.pmh.Record> searchRecord(org.mycore.oai.pmh.MetadataFormat format, MCRSet set, Instant from, Instant until)
    • getRecordList

      protected org.mycore.oai.pmh.OAIDataList<org.mycore.oai.pmh.Record> getRecordList(MCROAISearcher searcher, MCROAIResult result)
    • getHeaderList

      protected org.mycore.oai.pmh.OAIDataList<org.mycore.oai.pmh.Header> getHeaderList(MCROAISearcher searcher, MCROAIResult result)
    • getSearchId

      public String getSearchId(String token) throws org.mycore.oai.pmh.BadResumptionTokenException
      Throws:
      org.mycore.oai.pmh.BadResumptionTokenException
    • getTokenCursor

      public String getTokenCursor(String token) throws org.mycore.oai.pmh.BadResumptionTokenException
      Throws:
      org.mycore.oai.pmh.BadResumptionTokenException
    • setResumptionToken

      protected void setResumptionToken(org.mycore.oai.pmh.OAIDataList<?> dataList, MCROAISearcher searcher, MCROAIResult result)
    • getPartitionSize

      public int getPartitionSize()
    • getSearcher

      public static MCROAISearcher getSearcher(MCROAIIdentify identify, org.mycore.oai.pmh.MetadataFormat format, int partitionSize, MCROAISetManager setManager, MCROAIObjectManager objectManager)