Package org.apache.maven.index.updater
Class DefaultIndexUpdater
- java.lang.Object
-
- org.apache.maven.index.updater.DefaultIndexUpdater
-
- All Implemented Interfaces:
IndexUpdater
@Singleton @Named public class DefaultIndexUpdater extends java.lang.Object implements IndexUpdater
A default index updater implementation- Author:
- Jason van Zyl, Eugene Kuleshov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultIndexUpdater.FileFetcherFilesystem-based ResourceFetcher implementation
-
Constructor Summary
Constructors Constructor Description DefaultIndexUpdater(IncrementalHandler incrementalHandler, java.util.List<IndexUpdateSideEffect> sideEffects)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanCacheDirectory(java.io.File dir)Cleans specified cache directory.IndexUpdateResultfetchAndUpdateIndex(IndexUpdateRequest updateRequest)protected org.slf4j.LoggergetLogger()java.util.DategetTimestamp(java.util.Properties properties, java.lang.String key)static IndexDataReader.IndexDataReadResultunpackIndexData(java.io.InputStream is, org.apache.lucene.store.Directory d, IndexingContext context)Unpack index data using specified Lucene Index writer
-
-
-
Constructor Detail
-
DefaultIndexUpdater
@Inject public DefaultIndexUpdater(IncrementalHandler incrementalHandler, java.util.List<IndexUpdateSideEffect> sideEffects)
-
-
Method Detail
-
getLogger
protected org.slf4j.Logger getLogger()
-
fetchAndUpdateIndex
public IndexUpdateResult fetchAndUpdateIndex(IndexUpdateRequest updateRequest) throws java.io.IOException
- Specified by:
fetchAndUpdateIndexin interfaceIndexUpdater- Returns:
- IndexUpdateResult
- Throws:
java.io.IOException
-
getTimestamp
public java.util.Date getTimestamp(java.util.Properties properties, java.lang.String key)
-
unpackIndexData
public static IndexDataReader.IndexDataReadResult unpackIndexData(java.io.InputStream is, org.apache.lucene.store.Directory d, IndexingContext context) throws java.io.IOException
Unpack index data using specified Lucene Index writer- Parameters:
is- an input stream to unpack index data fromw- a writer to save index dataics- a collection of index creators for updating unpacked documents.- Throws:
java.io.IOException
-
cleanCacheDirectory
protected void cleanCacheDirectory(java.io.File dir) throws java.io.IOExceptionCleans specified cache directory. If present, Locker.LOCK_FILE will not be deleted.- Throws:
java.io.IOException
-
-