Package org.apache.maven.index
Class DefaultNexusIndexer
java.lang.Object
org.apache.maven.index.DefaultNexusIndexer
- All Implemented Interfaces:
- NexusIndexer
@Deprecated
@Singleton
@Named
public class DefaultNexusIndexer
extends Object
implements NexusIndexer
Deprecated.
A default 
NexusIndexer implementation.- Author:
- Tamas Cservenak, Eugene Kuleshov
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultNexusIndexer(Indexer indexer, Scanner scanner, IndexerEngine indexerEngine, QueryCreator queryCreator) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddArtifactsToIndex(Collection<ArtifactContext> acs, IndexingContext context) Deprecated.voidaddArtifactToIndex(ArtifactContext ac, IndexingContext context) Deprecated.Delegates to theIndexerEngineto update artifact to the indexaddIndexingContext(String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) Deprecated.Adds an indexing context to Nexus indexer.addIndexingContext(String id, String repositoryId, File repository, org.apache.lucene.store.Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) Deprecated.Adds an indexing context to Nexus indexer.voidaddIndexingContext(IndexingContext context) Deprecated.Adds an indexing context to Nexus indexer.addIndexingContextForced(String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) Deprecated.Adds an indexing context to Nexus indexer.addIndexingContextForced(String id, String repositoryId, File repository, org.apache.lucene.store.Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) Deprecated.Adds an indexing context to Nexus indexer.addMergedIndexingContext(String id, String repositoryId, File repository, File indexDirectory, boolean searchable, Collection<IndexingContext> contexts) Deprecated.addMergedIndexingContext(String id, String repositoryId, File repository, File indexDirectory, boolean searchable, ContextMemberProvider membersProvider) Deprecated.addMergedIndexingContext(String id, String repositoryId, File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, Collection<IndexingContext> contexts) Deprecated.addMergedIndexingContext(String id, String repositoryId, File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, ContextMemberProvider membersProvider) Deprecated.voidartifactDiscovered(ArtifactContext ac, IndexingContext context) Deprecated.Delegates to theIndexerEngineto add a new artifact to the indexorg.apache.lucene.search.QueryconstructQuery(Field field, String query, SearchType type) Deprecated.org.apache.lucene.search.QueryconstructQuery(Field field, SearchExpression expression) Deprecated.Helper method to construct Lucene query for given field without need for knowledge (on caller side) HOW is a field indexed, and WHAT query is needed to achieve that.voiddeleteArtifactFromIndex(ArtifactContext ac, IndexingContext context) Deprecated.Delegates to theIndexerEngineto remove artifact from the indexvoiddeleteArtifactsFromIndex(Collection<ArtifactContext> acs, IndexingContext context) Deprecated.Deprecated.Returns the map of indexing contexts keyed by their ID.Deprecated.identify(File artifact, Collection<IndexingContext> contexts) Deprecated.identify(org.apache.lucene.search.Query query) Deprecated.identify(org.apache.lucene.search.Query query, Collection<IndexingContext> contexts) Deprecated.Deprecated.voidremoveIndexingContext(IndexingContext context, boolean deleteFiles) Deprecated.Removes the indexing context from Nexus indexer, closes it and deletes (if specified) the index files.voidscan(IndexingContext context) Deprecated.Performs full scan (reindex) for the local repository belonging to supplied context.voidscan(IndexingContext context, boolean update) Deprecated.Performs optionally incremental scan (reindex/full reindex) for the local repository belonging to the supplied context.voidscan(IndexingContext context, String fromPath, ArtifactScanningListener listener, boolean update) Deprecated.UsesScannerto scan repository content.voidscan(IndexingContext context, ArtifactScanningListener listener) Deprecated.Performs full scan (reindex) for the local repository belonging to supplied context.voidscan(IndexingContext context, ArtifactScanningListener listener, boolean update) Deprecated.Performs optionally incremental scan (reindex) for the local repository, with listener.searchFlat(FlatSearchRequest request) Deprecated.Searches according the request parameters.searchGrouped(GroupedSearchRequest request) Deprecated.Searches according the request parameters.searchIterator(IteratorSearchRequest request) Deprecated.Searches according to request parameters.
- 
Constructor Details- 
DefaultNexusIndexer@Inject public DefaultNexusIndexer(Indexer indexer, Scanner scanner, IndexerEngine indexerEngine, QueryCreator queryCreator) Deprecated.
 
- 
- 
Method Details- 
addIndexingContextDeprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer.- Specified by:
- addIndexingContextin interface- NexusIndexer
 
- 
addIndexingContextpublic IndexingContext addIndexingContext(String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) throws IOException, UnsupportedExistingLuceneIndexException Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer.- Specified by:
- addIndexingContextin interface- NexusIndexer
- Parameters:
- id- the ID of the context.
- repositoryId- the ID of the repository that this context represents.
- repository- the location of the repository.
- indexDirectory- the location of the Lucene indexes.
- repositoryUrl- the location of the remote repository.
- indexUpdateUrl- the alternate location of the remote repository indexes (if they are not in default place).
- indexers- the set of indexers to apply to this context.
- Returns:
- Throws:
- IOException- in case of some serious IO problem.
- UnsupportedExistingLuceneIndexException- if a Lucene index already exists where location is specified, but it has no Nexus descriptor record or it has, but the embedded repoId differs from the repoId specified from the supplied one.
 
- 
addIndexingContextForcedpublic IndexingContext addIndexingContextForced(String id, String repositoryId, File repository, File indexDirectory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) throws IOException Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer. It "forces" this operation, thus no UnsupportedExistingLuceneIndexException is thrown. If it founds an existing lucene index, it will simply stomp-over and rewrite (or add) the Nexus index descriptor.- Specified by:
- addIndexingContextForcedin interface- NexusIndexer
- Parameters:
- id- the ID of the context.
- repositoryId- the ID of the repository that this context represents.
- repository- the location of the repository.
- indexDirectory- the location of the Lucene indexes.
- repositoryUrl- the location of the remote repository.
- indexUpdateUrl- the alternate location of the remote repository indexes (if they are not in default place).
- indexers- the set of indexers to apply to this context.
- Returns:
- Throws:
- IOException- in case of some serious IO problem.
 
- 
addIndexingContextpublic IndexingContext addIndexingContext(String id, String repositoryId, File repository, org.apache.lucene.store.Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) throws IOException, UnsupportedExistingLuceneIndexException Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer.- Specified by:
- addIndexingContextin interface- NexusIndexer
- Parameters:
- id- the ID of the context.
- repositoryId- the ID of the repository that this context represents.
- repository- the location of the repository.
- directory- the location of the Lucene indexes.
- repositoryUrl- the location of the remote repository.
- indexUpdateUrl- the alternate location of the remote repository indexes (if they are not in default place).
- indexers- the set of indexers to apply to this context.
- Returns:
- Throws:
- IOException- in case of some serious IO problem.
- UnsupportedExistingLuceneIndexException- if a Lucene index already exists where location is specified, but it has no Nexus descriptor record or it has, but the embedded repoId differs from the repoId specified from the supplied one.
 
- 
addIndexingContextForcedpublic IndexingContext addIndexingContextForced(String id, String repositoryId, File repository, org.apache.lucene.store.Directory directory, String repositoryUrl, String indexUpdateUrl, List<? extends IndexCreator> indexers) throws IOException Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer. It "forces" this operation, thus no UnsupportedExistingLuceneIndexException is thrown. If it founds an existing lucene index, it will simply stomp-over and rewrite (or add) the Nexus index descriptor.- Specified by:
- addIndexingContextForcedin interface- NexusIndexer
- Parameters:
- id- the ID of the context.
- repositoryId- the ID of the repository that this context represents.
- repository- the location of the repository.
- directory- the location of the Lucene indexes.
- repositoryUrl- the location of the remote repository.
- indexUpdateUrl- the alternate location of the remote repository indexes (if they are not in default place).
- indexers- the set of indexers to apply to this context.
- Returns:
- Throws:
- IOException- in case of some serious IO problem.
 
- 
addMergedIndexingContextpublic IndexingContext addMergedIndexingContext(String id, String repositoryId, File repository, File indexDirectory, boolean searchable, Collection<IndexingContext> contexts) throws IOException Deprecated.- Specified by:
- addMergedIndexingContextin interface- NexusIndexer
- Throws:
- IOException
 
- 
addMergedIndexingContextpublic IndexingContext addMergedIndexingContext(String id, String repositoryId, File repository, File indexDirectory, boolean searchable, ContextMemberProvider membersProvider) throws IOException Deprecated.- Specified by:
- addMergedIndexingContextin interface- NexusIndexer
- Throws:
- IOException
 
- 
addMergedIndexingContextpublic IndexingContext addMergedIndexingContext(String id, String repositoryId, File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, Collection<IndexingContext> contexts) throws IOException Deprecated.- Specified by:
- addMergedIndexingContextin interface- NexusIndexer
- Throws:
- IOException
 
- 
addMergedIndexingContextpublic IndexingContext addMergedIndexingContext(String id, String repositoryId, File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, ContextMemberProvider membersProvider) throws IOException Deprecated.- Specified by:
- addMergedIndexingContextin interface- NexusIndexer
- Throws:
- IOException
 
- 
removeIndexingContextDeprecated.Description copied from interface:NexusIndexerRemoves the indexing context from Nexus indexer, closes it and deletes (if specified) the index files.- Specified by:
- removeIndexingContextin interface- NexusIndexer
- Parameters:
- context-
- deleteFiles-
- Throws:
- IOException
 
- 
getIndexingContextsDeprecated.Description copied from interface:NexusIndexerReturns the map of indexing contexts keyed by their ID.- Specified by:
- getIndexingContextsin interface- NexusIndexer
 
- 
scanDeprecated.Description copied from interface:NexusIndexerPerforms full scan (reindex) for the local repository belonging to supplied context.- Specified by:
- scanin interface- NexusIndexer
- Parameters:
- context-
- Throws:
- IOException
 
- 
scanDeprecated.Description copied from interface:NexusIndexerPerforms optionally incremental scan (reindex/full reindex) for the local repository belonging to the supplied context.- Specified by:
- scanin interface- NexusIndexer
- Parameters:
- context-
- update- if incremental reindex wanted, set true, otherwise false and full reindex will happen
- Throws:
- IOException
 
- 
scanDeprecated.Description copied from interface:NexusIndexerPerforms full scan (reindex) for the local repository belonging to supplied context. ArtifactListener is used during that process.- Specified by:
- scanin interface- NexusIndexer
- Parameters:
- context-
- listener-
- Throws:
- IOException
 
- 
scanpublic void scan(IndexingContext context, ArtifactScanningListener listener, boolean update) throws IOException Deprecated.Description copied from interface:NexusIndexerPerforms optionally incremental scan (reindex) for the local repository, with listener.- Specified by:
- scanin interface- NexusIndexer
- Parameters:
- context-
- listener-
- update- if incremental reindex wanted, set true, otherwise false and full reindex will happen
- Throws:
- IOException
 
- 
scanpublic void scan(IndexingContext context, String fromPath, ArtifactScanningListener listener, boolean update) throws IOException Deprecated.UsesScannerto scan repository content. AArtifactScanningListeneris used to process found artifacts and to add them to the index usingNexusIndexer.artifactDiscovered(ArtifactContext, IndexingContext).- Specified by:
- scanin interface- NexusIndexer
- Parameters:
- context-
- fromPath- a path segment if you want "sub-path" reindexing (ie. reindex just a given subfolder of a repository, ot whole repository from root.
- listener-
- update- if incremental reindex wanted, set true, otherwise false and full reindex will happen
- Throws:
- IOException
- See Also:
 
- 
artifactDiscoveredDeprecated.Delegates to theIndexerEngineto add a new artifact to the index- Specified by:
- artifactDiscoveredin interface- NexusIndexer
- Throws:
- IOException
 
- 
addArtifactToIndexDeprecated.Delegates to theIndexerEngineto update artifact to the index- Specified by:
- addArtifactToIndexin interface- NexusIndexer
- Throws:
- IOException
 
- 
addArtifactsToIndexpublic void addArtifactsToIndex(Collection<ArtifactContext> acs, IndexingContext context) throws IOException Deprecated.- Specified by:
- addArtifactsToIndexin interface- NexusIndexer
- Throws:
- IOException
 
- 
deleteArtifactFromIndexDeprecated.Delegates to theIndexerEngineto remove artifact from the index- Specified by:
- deleteArtifactFromIndexin interface- NexusIndexer
- Throws:
- IOException
 
- 
deleteArtifactsFromIndexpublic void deleteArtifactsFromIndex(Collection<ArtifactContext> acs, IndexingContext context) throws IOException Deprecated.- Specified by:
- deleteArtifactsFromIndexin interface- NexusIndexer
- Throws:
- IOException
 
- 
searchFlatDeprecated.Description copied from interface:NexusIndexerSearches according the request parameters.- Specified by:
- searchFlatin interface- NexusIndexer
- Parameters:
- request-
- Returns:
- Throws:
- IOException
 
- 
searchIteratorDeprecated.Description copied from interface:NexusIndexerSearches according to request parameters.- Specified by:
- searchIteratorin interface- NexusIndexer
- Parameters:
- request-
- Returns:
- Throws:
- IOException
 
- 
searchGroupedDeprecated.Description copied from interface:NexusIndexerSearches according the request parameters.- Specified by:
- searchGroupedin interface- NexusIndexer
- Parameters:
- request-
- Returns:
- Throws:
- IOException
 
- 
constructQuery@Deprecated public org.apache.lucene.search.Query constructQuery(Field field, String query, SearchType type) throws IllegalArgumentException Deprecated.Description copied from interface:NexusIndexerHelper method to construct Lucene query for given field without need for knowledge (on caller side) HOW is a field indexed, and WHAT query is needed to achieve that.- Specified by:
- constructQueryin interface- NexusIndexer
- Parameters:
- field-
- query-
- type-
- Returns:
- Throws:
- IllegalArgumentException
 
- 
constructQuerypublic org.apache.lucene.search.Query constructQuery(Field field, SearchExpression expression) throws IllegalArgumentException Deprecated.Description copied from interface:NexusIndexerHelper method to construct Lucene query for given field without need for knowledge (on caller side) HOW is a field indexed, and WHAT query is needed to achieve that.- Specified by:
- constructQueryin interface- NexusIndexer
- Parameters:
- field-
- expression-
- Returns:
- Throws:
- IllegalArgumentException
 
- 
identifypublic Collection<ArtifactInfo> identify(Field field, String query) throws IllegalArgumentException, IOException Deprecated.- Specified by:
- identifyin interface- NexusIndexer
- Throws:
- IllegalArgumentException
- IOException
 
- 
identifyDeprecated.- Specified by:
- identifyin interface- NexusIndexer
- Throws:
- IOException
 
- 
identifypublic Collection<ArtifactInfo> identify(File artifact, Collection<IndexingContext> contexts) throws IOException Deprecated.- Specified by:
- identifyin interface- NexusIndexer
- Throws:
- IOException
 
- 
identifyDeprecated.- Specified by:
- identifyin interface- NexusIndexer
- Throws:
- IOException
 
- 
identifypublic Collection<ArtifactInfo> identify(org.apache.lucene.search.Query query, Collection<IndexingContext> contexts) throws IOException Deprecated.- Specified by:
- identifyin interface- NexusIndexer
- Throws:
- IOException
 
 
- 
Indexerinstead. Discouraged from further use, as it suffers from multiple synchronization and other problems. As it tries to serve as "context registry" too, but it does not synchronize the access to it, but also, introduces some extras (like "targeted" vs "non targeted" search), that makes it's behavior less intuitive.