@Service(value="searchService#rest") public class DefaultSearchService extends AbstractRestService implements SearchService
Modifier and Type | Field and Description |
---|---|
private static String |
LATEST_KEYWORD |
private RepositorySearch |
repositorySearch |
private RepositorySessionFactory |
repositorySessionFactory |
archivaAdministration, config, httpServletRequest, httpServletResponse, log, managedRepositoryAdmin, proxyConnectorAdmin, repositoryContentFactory, repositoryTaskScheduler, userRepositories
Constructor and Description |
---|
DefaultSearchService() |
Modifier and Type | Method and Description |
---|---|
GroupIdList |
getAllGroupIds(List<String> selectedRepos)
this method applies on Maven Indexer lucene index, so datas not yet indexed won't be available
|
List<Artifact> |
getArtifactByChecksum(ChecksumSearch checksumSearch)
If searchRequest contains repositories, the search will be done only on those repositories.
|
protected List<Artifact> |
getArtifacts(SearchResults searchResults) |
protected List<Artifact> |
getArtifacts(SearchResults searchResults,
String repositoryId) |
List<Artifact> |
getArtifactVersions(String groupId,
String artifactId,
String packaging)
search will be apply on all repositories the current user has karma
|
StringList |
getObservablesRepoIds() |
List<Artifact> |
quickSearch(String queryString) |
List<Artifact> |
quickSearchWithRepositories(SearchRequest searchRequest)
if not repositories in SearchRequest: search will be apply on all repositories the current user has karma
|
javax.ws.rs.core.Response |
redirectToArtifactFile(String repositoryId,
String groupId,
String artifactId,
String version,
String packaging,
String classifier,
Boolean literalVersion)
Returns a redirect to a artifact file, that matches given search parameter
|
List<Artifact> |
searchArtifacts(SearchRequest searchRequest)
If searchRequest contains repositories, the search will be done only on those repositories.
|
buildArtifacts, doScanRepository, getArtifactUrl, getArtifactUrl, getAuditInformation, getAuditListeners, getBaseUrl, getBeansOfType, getModelMapper, getObservableRepos, getPrincipal, setAuditListeners, triggerAuditEvent
private static final String LATEST_KEYWORD
@Inject private RepositorySearch repositorySearch
@Inject private RepositorySessionFactory repositorySessionFactory
public DefaultSearchService()
public List<Artifact> quickSearch(String queryString) throws ArchivaRestServiceException
quickSearch
in interface SearchService
ArchivaRestServiceException
public List<Artifact> quickSearchWithRepositories(SearchRequest searchRequest) throws ArchivaRestServiceException
SearchService
quickSearchWithRepositories
in interface SearchService
ArchivaRestServiceException
public List<Artifact> getArtifactVersions(String groupId, String artifactId, String packaging) throws ArchivaRestServiceException
SearchService
getArtifactVersions
in interface SearchService
ArchivaRestServiceException
public List<Artifact> searchArtifacts(SearchRequest searchRequest) throws ArchivaRestServiceException
SearchService
searchArtifacts
in interface SearchService
ArchivaRestServiceException
public GroupIdList getAllGroupIds(List<String> selectedRepos) throws ArchivaRestServiceException
SearchService
getAllGroupIds
in interface SearchService
ArchivaRestServiceException
public List<Artifact> getArtifactByChecksum(ChecksumSearch checksumSearch) throws ArchivaRestServiceException
SearchService
getArtifactByChecksum
in interface SearchService
ArchivaRestServiceException
public StringList getObservablesRepoIds() throws ArchivaRestServiceException
getObservablesRepoIds
in interface SearchService
ArchivaRestServiceException
public javax.ws.rs.core.Response redirectToArtifactFile(String repositoryId, String groupId, String artifactId, String version, String packaging, String classifier, Boolean literalVersion) throws ArchivaRestServiceException
SearchService
redirectToArtifactFile
in interface SearchService
repositoryId
- The repository id (optional)groupId
- The search pattern for the group id of the artifact (required)artifactId
- The search pattern for the artifact id of the artifact (required)version
- The search pattern for the version of the artifact (required)
LATEST returns the latest version of the artifact.packaging
- the packagingclassifier
- the artifact classifierliteralVersion
- true, if the version string should be treated literally, which means
LATEST search for versions with LATEST in the version string.
false, is default and treats v=LATEST specialArchivaRestServiceException
protected List<Artifact> getArtifacts(SearchResults searchResults) throws ArchivaRestServiceException
ArchivaRestServiceException
protected List<Artifact> getArtifacts(SearchResults searchResults, String repositoryId) throws ArchivaRestServiceException
ArchivaRestServiceException
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.