Class MavenCentralSearchService
- java.lang.Object
- 
- org.jenkinsci.plugins.maven_artifact_choicelistprovider.central.MavenCentralSearchService
 
- 
- All Implemented Interfaces:
- IVersionReader
 
 public class MavenCentralSearchService extends Object implements IVersionReader Maven Central offers a search service located atREPO_SEARCH_SERVICE_URLwhich can be used to query the maven central repository via a RESTful interface. This class makes use of this API and return a list of artifacts.
 
 As the API is public, but Maven Central is the only service offering it, there is no reason to modify the URLs for searching and retrieving the artifacts.
 Anyway, if there should be another repository using the same API, this class can be inherited andgetSearchURL()andgetRetrieveURL()andcreateItemURLs(ResponseDoc, String)can be overriden.- Author:
- stephan.watermeyer, Diebold Nixdorf
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringREPO_RETRIEVE_URLstatic StringREPO_SEARCH_SERVICE_URL
 - 
Constructor SummaryConstructors Constructor Description MavenCentralSearchService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRetrieveURL()Can over overriden.StringgetSearchURL()List<String>retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier)voidsetCredentials(String pUserName, String pUserPassword)voidsetUserName(String pUserName)voidsetUserPassword(String pUserPassword)
 
- 
- 
- 
Field Detail- 
REPO_RETRIEVE_URLpublic static final String REPO_RETRIEVE_URL - See Also:
- Constant Field Values
 
 - 
REPO_SEARCH_SERVICE_URLpublic static final String REPO_SEARCH_SERVICE_URL - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
retrieveVersionspublic List<String> retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier) throws VersionReaderException - Specified by:
- retrieveVersionsin interface- IVersionReader
- Throws:
- VersionReaderException
 
 - 
setUserNamepublic void setUserName(String pUserName) - Specified by:
- setUserNamein interface- IVersionReader
 
 - 
setUserPasswordpublic void setUserPassword(String pUserPassword) - Specified by:
- setUserPasswordin interface- IVersionReader
 
 - 
setCredentialspublic void setCredentials(String pUserName, String pUserPassword) - Specified by:
- setCredentialsin interface- IVersionReader
 
 - 
getSearchURLpublic String getSearchURL() 
 - 
getRetrieveURLpublic String getRetrieveURL() Can over overriden.- Returns:
- the URL where the artifacts are stored.
 
 
- 
 
-