public class GitHubRepositoryService extends AbstractRepositoryService
baseUrl, config, REPOSITORY_TYPE| Constructor and Description |
|---|
GitHubRepositoryService() |
| 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. |
void |
addLabelToPatch(Patch patch,
String labelName)
Attach a label to the specified patch.
|
List<Patch> |
findPatchesRelatedTo(Patch patch)
Find all the patches related to the given patch.
|
CommitStatus |
getCommitStatusFromPatch(Patch patch)
Retrieve the current CI status of the latest commit associated with a given patch.
|
List<Label> |
getLabelsFromPatch(Patch patch)
Retrieve all labels associated with the provided
Patch object. |
List<Label> |
getLabelsFromRepository(Repository repository)
Retrieve all labels associated with the provided
Patch in Repository object. |
protected 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 |
hasModifiableLabels(Repository repository)
Discover if the user logged into this
RepositoryService has the correct permissions to apply/remove
labels to patches in the provided Repository |
boolean |
init(RepositoryConfig config)
Initiate this
RepositoryService using the supplied RepositoryConfig. |
void |
removeLabelFromPatch(Patch patch,
String name)
Delete a label from the provided
Patch object. |
boolean |
repositoryAccessable(URL url)
Checks whether the provided
URL is accessable. |
void |
setLabelsToPatch(Patch patch,
List<Label> labels)
Set the labels for the provided
Patch object. |
checkHost, init, urlExistsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroyprotected org.apache.commons.logging.Log getLog()
getLog in class AbstractRepositoryServicepublic boolean init(RepositoryConfig config)
RepositoryServiceRepositoryService using the supplied RepositoryConfig.init in interface RepositoryServiceinit in class AbstractRepositoryServiceconfig - a RepositoryConfig object containing all configuration information.true if the service was initialised without errors, false otherwise.public Patch getPatch(URL url) throws NotFoundException
RepositoryServicePatch located at the provided URL.getPatch in interface RepositoryServicegetPatch in class AbstractRepositoryServiceurl - the URL of the patch to be retrieved.Patch object.NotFoundException - if a Patch cannot be found at the provided base url.public Repository getRepository(URL url) throws NotFoundException
RepositoryServiceURL.getRepository in interface RepositoryServicegetRepository in class AbstractRepositoryServiceurl - the URL of the repository to be retrieved.Repository object.NotFoundException - if a Repository cannot be found at the provided base url.public List<Patch> getPatchesAssociatedWith(Issue issue) throws NotFoundException
RepositoryServiceIssue objectgetPatchesAssociatedWith in interface RepositoryServicegetPatchesAssociatedWith in class AbstractRepositoryServiceissue - 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 RepositoryServicegetPatchesByState in class AbstractRepositoryServicerepository - 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 RepositoryServiceaddCommentToPatch in class AbstractRepositoryServicepatch - 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 hasModifiableLabels(Repository repository) throws NotFoundException
RepositoryServiceRepositoryService has the correct permissions to apply/remove
labels to patches in the provided Repositoryrepository - the Repository whose permissions are to be checkedNotFoundException - if the specified Repository cannot be found.public void addLabelToPatch(Patch patch, String labelName) throws NotFoundException
RepositoryServiceNotFoundException will be thrown. If the specified label is already
associated with the provided patch then no further action is taken.patch - the Patch to which the label will be applied.labelName - the name of the label to be applied.NotFoundException - if the specified labelName has not been defined at the remote repository.public List<Label> getLabelsFromRepository(Repository repository) throws NotFoundException
RepositoryServicePatch in Repository object.repository - the Repository object whose associated labels should be returned.Label objects, or an empty list if no label can be found.NotFoundException - if the provided Repository url not consistent with the baseURL.public List<Label> getLabelsFromPatch(Patch patch) throws NotFoundException
RepositoryServicePatch object.patch - the Patch object whose associated labels should be returned.Label objects, or an empty list if no patches can be found.NotFoundException - if the provided Patch url not consistent with the baseURL.public void setLabelsToPatch(Patch patch, List<Label> labels) throws NotFoundException
RepositoryServicePatch object.patch - the Patch object whose will be set.labels - the Label apply to the PatchNotFoundException - if the Label can not be found in the provided Patchpublic void removeLabelFromPatch(Patch patch, String name) throws NotFoundException
RepositoryServicePatch object.patch - the Patch whose label will be removed.name - the Label name will be removed.NotFoundException - if the Label name can not be found in the provided Patchpublic List<Patch> findPatchesRelatedTo(Patch patch)
RepositoryServicepatch - the Patch on which patches related are being searchedpublic CommitStatus getCommitStatusFromPatch(Patch patch) throws NotFoundException
RepositoryServicepatch - the Patch object whose status is to be queriedNotFoundException - if no commit status can be found for the provided patchpublic boolean repositoryAccessable(URL url)
RepositoryServiceURL is accessable.url - the URL to check.URL is accessable, otherwise false.Copyright © 2016 JBoss by Red Hat. All rights reserved.