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 java.lang.Object implements NexusIndexer
Deprecated.UseIndexerinstead. 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.A defaultNexusIndexerimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description private IndexerindexerDeprecated.private IndexerEngineindexerEngineDeprecated.private java.util.Map<java.lang.String,IndexingContext>indexingContextsDeprecated.private QueryCreatorqueryCreatorDeprecated.private ScannerscannerDeprecated.-
Fields inherited from interface org.apache.maven.index.NexusIndexer
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultNexusIndexer(Indexer indexer, Scanner scanner, IndexerEngine indexerEngine, QueryCreator queryCreator)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddArtifactsToIndex(java.util.Collection<ArtifactContext> acs, IndexingContext context)Deprecated.voidaddArtifactToIndex(ArtifactContext ac, IndexingContext context)Deprecated.Delegates to theIndexerEngineto update artifact to the indexIndexingContextaddIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers)Deprecated.Adds an indexing context to Nexus indexer.IndexingContextaddIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory directory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers)Deprecated.Adds an indexing context to Nexus indexer.voidaddIndexingContext(IndexingContext context)Deprecated.Adds an indexing context to Nexus indexer.IndexingContextaddIndexingContextForced(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers)Deprecated.Adds an indexing context to Nexus indexer.IndexingContextaddIndexingContextForced(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory directory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers)Deprecated.Adds an indexing context to Nexus indexer.IndexingContextaddMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, boolean searchable, java.util.Collection<IndexingContext> contexts)Deprecated.IndexingContextaddMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, boolean searchable, ContextMemberProvider membersProvider)Deprecated.IndexingContextaddMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, java.util.Collection<IndexingContext> contexts)Deprecated.IndexingContextaddMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.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, java.lang.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(java.util.Collection<ArtifactContext> acs, IndexingContext context)Deprecated.java.util.Map<java.lang.String,IndexingContext>getIndexingContexts()Deprecated.Returns the map of indexing contexts keyed by their ID.java.util.Collection<ArtifactInfo>identify(java.io.File artifact)Deprecated.java.util.Collection<ArtifactInfo>identify(java.io.File artifact, java.util.Collection<IndexingContext> contexts)Deprecated.java.util.Collection<ArtifactInfo>identify(org.apache.lucene.search.Query query)Deprecated.java.util.Collection<ArtifactInfo>identify(org.apache.lucene.search.Query query, java.util.Collection<IndexingContext> contexts)Deprecated.java.util.Collection<ArtifactInfo>identify(Field field, java.lang.String query)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, java.lang.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.FlatSearchResponsesearchFlat(FlatSearchRequest request)Deprecated.Searches according the request parameters.GroupedSearchResponsesearchGrouped(GroupedSearchRequest request)Deprecated.Searches according the request parameters.IteratorSearchResponsesearchIterator(IteratorSearchRequest request)Deprecated.Searches according to request parameters.
-
-
-
Field Detail
-
indexer
private final Indexer indexer
Deprecated.
-
scanner
private final Scanner scanner
Deprecated.
-
indexerEngine
private final IndexerEngine indexerEngine
Deprecated.
-
queryCreator
private final QueryCreator queryCreator
Deprecated.
-
indexingContexts
private final java.util.Map<java.lang.String,IndexingContext> indexingContexts
Deprecated.
-
-
Constructor Detail
-
DefaultNexusIndexer
@Inject public DefaultNexusIndexer(Indexer indexer, Scanner scanner, IndexerEngine indexerEngine, QueryCreator queryCreator)
Deprecated.
-
-
Method Detail
-
addIndexingContext
public void addIndexingContext(IndexingContext context)
Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer.- Specified by:
addIndexingContextin interfaceNexusIndexer
-
addIndexingContext
public IndexingContext addIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.IOException, UnsupportedExistingLuceneIndexException
Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer.- Specified by:
addIndexingContextin interfaceNexusIndexer- 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:
java.io.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.
-
addIndexingContextForced
public IndexingContext addIndexingContextForced(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.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 interfaceNexusIndexer- 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:
java.io.IOException- in case of some serious IO problem.
-
addIndexingContext
public IndexingContext addIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory directory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.IOException, UnsupportedExistingLuceneIndexException
Deprecated.Description copied from interface:NexusIndexerAdds an indexing context to Nexus indexer.- Specified by:
addIndexingContextin interfaceNexusIndexer- 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:
java.io.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.
-
addIndexingContextForced
public IndexingContext addIndexingContextForced(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory directory, java.lang.String repositoryUrl, java.lang.String indexUpdateUrl, java.util.List<? extends IndexCreator> indexers) throws java.io.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 interfaceNexusIndexer- 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:
java.io.IOException- in case of some serious IO problem.
-
addMergedIndexingContext
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, boolean searchable, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
Deprecated.- Specified by:
addMergedIndexingContextin interfaceNexusIndexer- Throws:
java.io.IOException
-
addMergedIndexingContext
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, java.io.File indexDirectory, boolean searchable, ContextMemberProvider membersProvider) throws java.io.IOException
Deprecated.- Specified by:
addMergedIndexingContextin interfaceNexusIndexer- Throws:
java.io.IOException
-
addMergedIndexingContext
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
Deprecated.- Specified by:
addMergedIndexingContextin interfaceNexusIndexer- Throws:
java.io.IOException
-
addMergedIndexingContext
public IndexingContext addMergedIndexingContext(java.lang.String id, java.lang.String repositoryId, java.io.File repository, org.apache.lucene.store.Directory indexDirectory, boolean searchable, ContextMemberProvider membersProvider) throws java.io.IOException
Deprecated.- Specified by:
addMergedIndexingContextin interfaceNexusIndexer- Throws:
java.io.IOException
-
removeIndexingContext
public void removeIndexingContext(IndexingContext context, boolean deleteFiles) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerRemoves the indexing context from Nexus indexer, closes it and deletes (if specified) the index files.- Specified by:
removeIndexingContextin interfaceNexusIndexer- Throws:
java.io.IOException
-
getIndexingContexts
public java.util.Map<java.lang.String,IndexingContext> getIndexingContexts()
Deprecated.Description copied from interface:NexusIndexerReturns the map of indexing contexts keyed by their ID.- Specified by:
getIndexingContextsin interfaceNexusIndexer
-
scan
public void scan(IndexingContext context) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerPerforms full scan (reindex) for the local repository belonging to supplied context.- Specified by:
scanin interfaceNexusIndexer- Throws:
java.io.IOException
-
scan
public void scan(IndexingContext context, boolean update) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerPerforms optionally incremental scan (reindex/full reindex) for the local repository belonging to the supplied context.- Specified by:
scanin interfaceNexusIndexerupdate- if incremental reindex wanted, set true, otherwise false and full reindex will happen- Throws:
java.io.IOException
-
scan
public void scan(IndexingContext context, ArtifactScanningListener listener) throws java.io.IOException
Deprecated.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 interfaceNexusIndexer- Throws:
java.io.IOException
-
scan
public void scan(IndexingContext context, ArtifactScanningListener listener, boolean update) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerPerforms optionally incremental scan (reindex) for the local repository, with listener.- Specified by:
scanin interfaceNexusIndexerupdate- if incremental reindex wanted, set true, otherwise false and full reindex will happen- Throws:
java.io.IOException
-
scan
public void scan(IndexingContext context, java.lang.String fromPath, ArtifactScanningListener listener, boolean update) throws java.io.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 interfaceNexusIndexerfromPath- a path segment if you want "sub-path" reindexing (ie. reindex just a given subfolder of a repository, ot whole repository from root.update- if incremental reindex wanted, set true, otherwise false and full reindex will happen- Throws:
java.io.IOException- See Also:
DefaultScannerListener,artifactDiscovered(ArtifactContext, IndexingContext)
-
artifactDiscovered
public void artifactDiscovered(ArtifactContext ac, IndexingContext context) throws java.io.IOException
Deprecated.Delegates to theIndexerEngineto add a new artifact to the index- Specified by:
artifactDiscoveredin interfaceNexusIndexer- Throws:
java.io.IOException
-
addArtifactToIndex
public void addArtifactToIndex(ArtifactContext ac, IndexingContext context) throws java.io.IOException
Deprecated.Delegates to theIndexerEngineto update artifact to the index- Specified by:
addArtifactToIndexin interfaceNexusIndexer- Throws:
java.io.IOException
-
addArtifactsToIndex
public void addArtifactsToIndex(java.util.Collection<ArtifactContext> acs, IndexingContext context) throws java.io.IOException
Deprecated.- Specified by:
addArtifactsToIndexin interfaceNexusIndexer- Throws:
java.io.IOException
-
deleteArtifactFromIndex
public void deleteArtifactFromIndex(ArtifactContext ac, IndexingContext context) throws java.io.IOException
Deprecated.Delegates to theIndexerEngineto remove artifact from the index- Specified by:
deleteArtifactFromIndexin interfaceNexusIndexer- Throws:
java.io.IOException
-
deleteArtifactsFromIndex
public void deleteArtifactsFromIndex(java.util.Collection<ArtifactContext> acs, IndexingContext context) throws java.io.IOException
Deprecated.- Specified by:
deleteArtifactsFromIndexin interfaceNexusIndexer- Throws:
java.io.IOException
-
searchFlat
public FlatSearchResponse searchFlat(FlatSearchRequest request) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerSearches according the request parameters.- Specified by:
searchFlatin interfaceNexusIndexer- Returns:
- Throws:
java.io.IOException
-
searchIterator
public IteratorSearchResponse searchIterator(IteratorSearchRequest request) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerSearches according to request parameters.- Specified by:
searchIteratorin interfaceNexusIndexer- Returns:
- Throws:
java.io.IOException
-
searchGrouped
public GroupedSearchResponse searchGrouped(GroupedSearchRequest request) throws java.io.IOException
Deprecated.Description copied from interface:NexusIndexerSearches according the request parameters.- Specified by:
searchGroupedin interfaceNexusIndexer- Returns:
- Throws:
java.io.IOException
-
constructQuery
@Deprecated public org.apache.lucene.search.Query constructQuery(Field field, java.lang.String query, SearchType type) throws java.lang.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 interfaceNexusIndexer- Returns:
- Throws:
java.lang.IllegalArgumentException
-
constructQuery
public org.apache.lucene.search.Query constructQuery(Field field, SearchExpression expression) throws java.lang.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 interfaceNexusIndexer- Returns:
- Throws:
java.lang.IllegalArgumentException
-
identify
public java.util.Collection<ArtifactInfo> identify(Field field, java.lang.String query) throws java.lang.IllegalArgumentException, java.io.IOException
Deprecated.- Specified by:
identifyin interfaceNexusIndexer- Throws:
java.lang.IllegalArgumentExceptionjava.io.IOException
-
identify
public java.util.Collection<ArtifactInfo> identify(java.io.File artifact) throws java.io.IOException
Deprecated.- Specified by:
identifyin interfaceNexusIndexer- Throws:
java.io.IOException
-
identify
public java.util.Collection<ArtifactInfo> identify(java.io.File artifact, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
Deprecated.- Specified by:
identifyin interfaceNexusIndexer- Throws:
java.io.IOException
-
identify
public java.util.Collection<ArtifactInfo> identify(org.apache.lucene.search.Query query) throws java.io.IOException
Deprecated.- Specified by:
identifyin interfaceNexusIndexer- Throws:
java.io.IOException
-
identify
public java.util.Collection<ArtifactInfo> identify(org.apache.lucene.search.Query query, java.util.Collection<IndexingContext> contexts) throws java.io.IOException
Deprecated.- Specified by:
identifyin interfaceNexusIndexer- Throws:
java.io.IOException
-
-