@Service(value="repositorySearch#maven") public class MavenRepositorySearch extends Object implements RepositorySearch
| Modifier and Type | Class and Description |
|---|---|
private static class |
MavenRepositorySearch.NullSearch |
| Modifier and Type | Field and Description |
|---|---|
private org.apache.maven.index.NexusIndexer |
indexer |
private org.slf4j.Logger |
log |
private ManagedRepositoryAdmin |
managedRepositoryAdmin |
private MavenIndexerUtils |
mavenIndexerUtils |
private ProxyConnectorAdmin |
proxyConnectorAdmin |
private org.apache.maven.index.QueryCreator |
queryCreator |
| Modifier | Constructor and Description |
|---|---|
protected |
MavenRepositorySearch() |
|
MavenRepositorySearch(PlexusSisuBridge plexusSisuBridge,
ManagedRepositoryAdmin managedRepositoryAdmin,
MavenIndexerUtils mavenIndexerUtils,
ProxyConnectorAdmin proxyConnectorAdmin) |
| Modifier and Type | Method and Description |
|---|---|
private List<String> |
addIndexingContexts(List<String> selectedRepos) |
private boolean |
applyArtifactInfoFilters(org.apache.maven.index.ArtifactInfo artifactInfo,
List<? extends ArtifactInfoFilter> artifactInfoFilters,
Map<String,SearchResultHit> currentResult) |
private void |
constructQuery(String term,
org.apache.lucene.search.BooleanQuery q) |
private SearchResults |
convertToSearchResults(org.apache.maven.index.FlatSearchResponse response,
SearchResultLimits limits,
List<? extends ArtifactInfoFilter> artifactInfoFilters,
List<String> selectedRepos,
boolean includePoms) |
Collection<String> |
getAllGroupIds(String principal,
List<String> selectedRepos) |
protected List<? extends org.apache.maven.index.context.IndexCreator> |
getAllIndexCreators() |
protected String |
getBaseUrl(org.apache.maven.index.ArtifactInfo artifactInfo,
List<String> selectedRepos)
calculate baseUrl without the context and base Archiva Url
|
private List<org.apache.maven.index.context.IndexingContext> |
getIndexingContexts(List<String> ids) |
private String |
getManagedRepoId(String remoteRepo,
List<String> selectedRepos)
return a managed repo for a remote result
|
Set<String> |
getRemoteIndexingContextIds(String managedRepoId) |
protected SearchResults |
paginate(SearchResults results) |
private SearchResults |
search(SearchResultLimits limits,
org.apache.lucene.search.BooleanQuery q,
List<String> indexingContextIds,
List<? extends ArtifactInfoFilter> filters,
List<String> selectedRepos,
boolean includePoms) |
SearchResults |
search(String principal,
List<String> selectedRepos,
String term,
SearchResultLimits limits,
List<String> previousSearchTerms)
Quick search by won't return artifact with file extension pom
|
SearchResults |
search(String principal,
SearchFields searchFields,
SearchResultLimits limits)
Advanced search.
|
private org.slf4j.Logger log
private org.apache.maven.index.NexusIndexer indexer
private org.apache.maven.index.QueryCreator queryCreator
private ManagedRepositoryAdmin managedRepositoryAdmin
private ProxyConnectorAdmin proxyConnectorAdmin
private MavenIndexerUtils mavenIndexerUtils
protected MavenRepositorySearch()
@Inject public MavenRepositorySearch(PlexusSisuBridge plexusSisuBridge, ManagedRepositoryAdmin managedRepositoryAdmin, MavenIndexerUtils mavenIndexerUtils, ProxyConnectorAdmin proxyConnectorAdmin) throws PlexusSisuBridgeException
PlexusSisuBridgeExceptionpublic SearchResults search(String principal, List<String> selectedRepos, String term, SearchResultLimits limits, List<String> previousSearchTerms) throws RepositorySearchException
RepositorySearchsearch in interface RepositorySearchRepositorySearchExceptionRepositorySearch.search(String, List, String, SearchResultLimits, List)public SearchResults search(String principal, SearchFields searchFields, SearchResultLimits limits) throws RepositorySearchException
RepositorySearchsearch in interface RepositorySearchRepositorySearchExceptionRepositorySearch.search(String, SearchFields, SearchResultLimits)private SearchResults search(SearchResultLimits limits, org.apache.lucene.search.BooleanQuery q, List<String> indexingContextIds, List<? extends ArtifactInfoFilter> filters, List<String> selectedRepos, boolean includePoms) throws RepositorySearchException
RepositorySearchExceptionprivate List<org.apache.maven.index.context.IndexingContext> getIndexingContexts(List<String> ids)
private void constructQuery(String term, org.apache.lucene.search.BooleanQuery q)
private List<String> addIndexingContexts(List<String> selectedRepos)
selectedRepos - public Set<String> getRemoteIndexingContextIds(String managedRepoId) throws RepositoryAdminException
getRemoteIndexingContextIds in interface RepositorySearchRepositoryAdminExceptionpublic Collection<String> getAllGroupIds(String principal, List<String> selectedRepos) throws RepositorySearchException
getAllGroupIds in interface RepositorySearchRepositorySearchExceptionprotected List<? extends org.apache.maven.index.context.IndexCreator> getAllIndexCreators()
private SearchResults convertToSearchResults(org.apache.maven.index.FlatSearchResponse response, SearchResultLimits limits, List<? extends ArtifactInfoFilter> artifactInfoFilters, List<String> selectedRepos, boolean includePoms) throws RepositoryAdminException
RepositoryAdminExceptionprotected String getBaseUrl(org.apache.maven.index.ArtifactInfo artifactInfo, List<String> selectedRepos) throws RepositoryAdminException
artifactInfo - RepositoryAdminExceptionprivate String getManagedRepoId(String remoteRepo, List<String> selectedRepos) throws RepositoryAdminException
remoteRepo - selectedRepos - RepositoryAdminExceptionprivate boolean applyArtifactInfoFilters(org.apache.maven.index.ArtifactInfo artifactInfo, List<? extends ArtifactInfoFilter> artifactInfoFilters, Map<String,SearchResultHit> currentResult)
protected SearchResults paginate(SearchResults results)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.