public abstract class AbstractRepositoryService extends Object implements RepositoryService
| Modifier and Type | Field and Description |
|---|---|
protected URL |
baseUrl |
protected RepositoryConfig |
config |
protected RepositoryType |
REPOSITORY_TYPE |
| Constructor and Description |
|---|
AbstractRepositoryService(RepositoryType REPOSITORY_TYPE) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCommentToPatch(Patch patch,
String comment)
Add a
Comment to the specified Patch object, and propagate the changes
to the remote repository. |
protected void |
checkHost(URL url) |
protected abstract org.apache.commons.logging.Log |
getLog() |
Patch |
getPatch(URL url)
Get the
Patch located at the provided URL. |
List<Patch> |
getPatchesAssociatedWith(Issue issue)
Retrieve all Patches associated with the provided
Issue object |
List<Patch> |
getPatchesByState(Repository repository,
PatchState state)
Retrieve all Patches associated with the provided
Repository object, which have a
state that matches the provided PatchState object. |
Repository |
getRepository(URL url)
Get the repository located at the provided
URL. |
boolean |
init(AphroditeConfig aphroditeConfig)
Initiate this
RepositoryService using the supplied AphroditeConfig. |
boolean |
init(RepositoryConfig config)
Initiate this
RepositoryService using the supplied RepositoryConfig. |
boolean |
urlExists(URL url)
Checks whether the provided
URL is on the same host as this service. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLabelToPatch, destroy, findPatchesRelatedTo, getCommitStatusFromPatch, getLabelsFromPatch, getLabelsFromRepository, hasModifiableLabels, removeLabelFromPatch, repositoryAccessable, setLabelsToPatchprotected final RepositoryType REPOSITORY_TYPE
protected RepositoryConfig config
protected URL baseUrl
public AbstractRepositoryService(RepositoryType REPOSITORY_TYPE)
protected abstract org.apache.commons.logging.Log getLog()
public boolean init(AphroditeConfig aphroditeConfig)
RepositoryServiceRepositoryService using the supplied AphroditeConfig.
The first RepositoryConfig object found in AphroditeConfig object,
is used to initiate the service and is subsequently removed from the config to prevent the same
service being initiated twice.init in interface RepositoryServiceaphroditeConfig - a AphroditeConfig object containing at least one
RepositoryConfig object.true if the service was initialised without errors, false otherwise.public boolean init(RepositoryConfig config)
RepositoryServiceRepositoryService using the supplied RepositoryConfig.init in interface RepositoryServiceconfig - a RepositoryConfig object containing all configuration information.true if the service was initialised without errors, false otherwise.public Repository getRepository(URL url) throws NotFoundException
RepositoryServiceURL.getRepository in interface RepositoryServiceurl - the URL of the repository to be retrieved.Repository object.NotFoundException - if a Repository cannot be found at the provided base url.public Patch getPatch(URL url) throws NotFoundException
RepositoryServicePatch located at the provided URL.getPatch in interface RepositoryServiceurl - the URL of the patch to be retrieved.Patch object.NotFoundException - if a Patch cannot be found at the provided base url.public List<Patch> getPatchesAssociatedWith(Issue issue) throws NotFoundException
RepositoryServiceIssue objectgetPatchesAssociatedWith in interface RepositoryServiceissue - the Issue object whose associated Patches should be returned.Patch objects, or an empty list if no patches can be found.NotFoundException - if an exception is thrown when searching the RepositoryService.public List<Patch> getPatchesByState(Repository repository, PatchState state) throws NotFoundException
RepositoryServiceRepository object, which have a
state that matches the provided PatchState object.getPatchesByState in interface RepositoryServicerepository - the Repository object whose associated Patches should be returned.state - the PatchState which the returned Patch objects must have.Patch objects, or an empty list if no patches can be found.NotFoundException - if the provided Repository cannot be found at the RepositoryService.public void addCommentToPatch(Patch patch, String comment) throws NotFoundException
RepositoryServiceComment to the specified Patch object, and propagate the changes
to the remote repository.addCommentToPatch in interface RepositoryServicepatch - the Patch on which the comment will be made.comment - the new Comment.NotFoundException - if the Patch cannot be found at the remote repository.public boolean urlExists(URL url)
RepositoryServiceURL is on the same host as this service.urlExists in interface RepositoryServiceurl - the URL to check.URL has the same host as this service, otherwise false.protected void checkHost(URL url) throws NotFoundException
NotFoundExceptionCopyright © 2016 JBoss by Red Hat. All rights reserved.