Class IndexGeneratorTimerTask

java.lang.Object
java.util.TimerTask
edu.ucsb.nceas.metacat.index.queue.IndexGeneratorTimerTask
All Implemented Interfaces:
Runnable

public class IndexGeneratorTimerTask extends TimerTask
A timer to regenerate failed index tasks or index tasks in a given time frame.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Overwrite and do nothing
    protected static org.dataone.service.types.v2.SystemMetadata
    Get the SystemMetadata for the specified id from the distributed Map.
    void
    index(Date since)
    Build the index for the docs which have been modified since the specified date.
    void
    index(Date since, Date until)
    Build the index for the docs which have been modified between the specified dates.
    protected static void
    index(List<String> metacatIds)
    Put the ids into the index queue
    void
    Build the index for all documents.
    static boolean
    isResourceMap(org.dataone.service.types.v1.ObjectFormatIdentifier formatId)
    If the specified ObjectFormatIdentifier is a resroucemap namespace.
    void
    run()
     
    protected static void
    Submit the index task to the queue for the given id

    Methods inherited from class java.util.TimerTask

    scheduledExecutionTime

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • IndexGeneratorTimerTask

      public IndexGeneratorTimerTask()
      Constructor
      Parameters:
      solrIndex -
      systemMetadataListener -
  • Method Details

    • indexAll

      public void indexAll() throws org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, org.apache.solr.client.solrj.SolrServerException, ClassNotFoundException, InstantiationException, IllegalAccessException, XPathExpressionException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, IOException, SAXException, ParserConfigurationException, org.dspace.foresite.OREParserException
      Build the index for all documents.
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      org.dataone.service.exceptions.ServiceFailure
      org.dataone.service.exceptions.NotImplemented
      org.dataone.service.exceptions.NotAuthorized
      org.dataone.service.exceptions.InvalidToken
      org.dataone.service.exceptions.InvalidRequest
      IndexEventLogException
      IllegalAccessException
      InstantiationException
      ClassNotFoundException
      ParserConfigurationException
      SAXException
      IOException
      org.dataone.service.exceptions.UnsupportedType
      org.dataone.service.exceptions.NotFound
      XPathExpressionException
      org.dspace.foresite.OREParserException
    • index

      public void index(Date since) throws org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, org.apache.solr.client.solrj.SolrServerException, ClassNotFoundException, InstantiationException, IllegalAccessException, XPathExpressionException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, IOException, SAXException, ParserConfigurationException, org.dspace.foresite.OREParserException
      Build the index for the docs which have been modified since the specified date.
      Parameters:
      since -
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      org.dataone.service.exceptions.ServiceFailure
      org.dataone.service.exceptions.NotImplemented
      org.dataone.service.exceptions.NotAuthorized
      org.dataone.service.exceptions.InvalidToken
      org.dataone.service.exceptions.InvalidRequest
      IndexEventLogException
      IllegalAccessException
      InstantiationException
      ClassNotFoundException
      ParserConfigurationException
      SAXException
      IOException
      org.dataone.service.exceptions.UnsupportedType
      org.dataone.service.exceptions.NotFound
      XPathExpressionException
      org.dspace.foresite.OREParserException
    • index

      public void index(Date since, Date until) throws org.apache.solr.client.solrj.SolrServerException, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, ClassNotFoundException, InstantiationException, IllegalAccessException, XPathExpressionException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.UnsupportedType, IOException, SAXException, ParserConfigurationException, org.dspace.foresite.OREParserException
      Build the index for the docs which have been modified between the specified dates.
      Parameters:
      since - the start date
      until - the end date
      Throws:
      org.apache.solr.client.solrj.SolrServerException
      org.dataone.service.exceptions.ServiceFailure
      org.dataone.service.exceptions.NotImplemented
      org.dataone.service.exceptions.NotAuthorized
      org.dataone.service.exceptions.InvalidToken
      org.dataone.service.exceptions.InvalidRequest
      IndexEventLogException
      IllegalAccessException
      InstantiationException
      ClassNotFoundException
      ParserConfigurationException
      SAXException
      IOException
      org.dataone.service.exceptions.UnsupportedType
      org.dataone.service.exceptions.NotFound
      XPathExpressionException
      org.dspace.foresite.OREParserException
    • index

      protected static void index(List<String> metacatIds)
      Put the ids into the index queue
      Parameters:
      metacatIds - the list of ids will be put into the index queue
    • submitIndex

      protected static void submitIndex(String id) throws Exception
      Submit the index task to the queue for the given id
      Parameters:
      id - the id will be submitted
      Throws:
      Exception
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Specified by:
      run in class TimerTask
    • isResourceMap

      public static boolean isResourceMap(org.dataone.service.types.v1.ObjectFormatIdentifier formatId)
      If the specified ObjectFormatIdentifier is a resroucemap namespace.
      Parameters:
      formatId - the given format id
    • getSystemMetadata

      protected static org.dataone.service.types.v2.SystemMetadata getSystemMetadata(String id) throws org.dataone.service.exceptions.ServiceFailure
      Get the SystemMetadata for the specified id from the distributed Map. The null maybe is returned if there is no system metadata found.
      Parameters:
      id - the specified id.
      Returns:
      the SystemMetadata associated with the id.
      Throws:
      org.dataone.service.exceptions.ServiceFailure
    • cancel

      public boolean cancel()
      Overwrite and do nothing
      Overrides:
      cancel in class TimerTask