Class IndexGeneratorTimerTask
java.lang.Object
java.util.TimerTask
edu.ucsb.nceas.metacat.index.queue.IndexGeneratorTimerTask
- All Implemented Interfaces:
Runnable
A timer to regenerate failed index tasks or index tasks in a given time frame.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel()Overwrite and do nothingprotected static org.dataone.service.types.v2.SystemMetadataGet the SystemMetadata for the specified id from the distributed Map.voidBuild the index for the docs which have been modified since the specified date.voidBuild the index for the docs which have been modified between the specified dates.protected static voidPut the ids into the index queuevoidindexAll()Build the index for all documents.static booleanisResourceMap(org.dataone.service.types.v1.ObjectFormatIdentifier formatId) If the specified ObjectFormatIdentifier is a resroucemap namespace.voidrun()protected static voidsubmitIndex(String id) Submit the index task to the queue for the given idMethods inherited from class TimerTask
scheduledExecutionTime
-
Field Details
-
WAITTIME
public static final int WAITTIME- See Also:
-
MAXWAITNUMBER
public static final int MAXWAITNUMBER- See Also:
-
-
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.OREParserExceptionBuild the index for all documents. -
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-
-
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 dateuntil- the end date
-
index
-
submitIndex
-
run
-
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
-