public interface RepositoryService
| 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.
|
default void |
destroy()
allows to destroy and deallocate resources
|
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. |
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(AphroditeConfig config)
Initiate this
RepositoryService using the supplied AphroditeConfig. |
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. |
boolean |
urlExists(URL url)
Checks whether the provided
URL is on the same host as this service. |
boolean init(AphroditeConfig config)
RepositoryService 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.config - a AphroditeConfig object containing at least one
RepositoryConfig object.true if the service was initialised without errors, false otherwise.IllegalArgumentException - if no RepositoryConfig objects are present.boolean init(RepositoryConfig config)
RepositoryService using the supplied RepositoryConfig.config - a RepositoryConfig object containing all configuration information.true if the service was initialised without errors, false otherwise.boolean urlExists(URL url)
URL is on the same host as this service.url - the URL to check.URL has the same host as this service, otherwise false.NullPointerException - if the provided URL is null.boolean repositoryAccessable(URL url)
URL is accessable.url - the URL to check.URL is accessable, otherwise false.Repository getRepository(URL url) throws NotFoundException
URL.url - the URL of the repository to be retrieved.Repository object.NotFoundException - if a Repository cannot be found at the provided base url.Patch getPatch(URL url) throws NotFoundException
Patch located at the provided URL.url - the URL of the patch to be retrieved.Patch object.NotFoundException - if a Patch cannot be found at the provided base url.List<Patch> getPatchesAssociatedWith(Issue issue) throws NotFoundException
Issue objectissue - 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.List<Patch> getPatchesByState(Repository repository, PatchState state) throws NotFoundException
Repository object, which have a
state that matches the provided PatchState object.repository - 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.List<Label> getLabelsFromRepository(Repository repository) throws NotFoundException
Patch 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.List<Label> getLabelsFromPatch(Patch patch) throws NotFoundException
Patch 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.boolean hasModifiableLabels(Repository repository) throws NotFoundException
RepositoryService 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.void setLabelsToPatch(Patch patch, List<Label> labels) throws NotFoundException, AphroditeException
Patch 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 PatchAphroditeException - if add the Label is not consistent with get labelsvoid removeLabelFromPatch(Patch patch, String name) throws NotFoundException
Patch 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 Patchvoid addCommentToPatch(Patch patch, String comment) throws NotFoundException
Comment to the specified Patch object, and propagate the changes
to the remote repository.patch - the Patch on which the comment will be made.comment - the new Comment.NotFoundException - if the Patch cannot be found at the remote repository.void addLabelToPatch(Patch patch, String labelName) throws NotFoundException
NotFoundException 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.List<Patch> findPatchesRelatedTo(Patch patch)
patch - the Patch on which patches related are being searchedCommitStatus getCommitStatusFromPatch(Patch patch) throws NotFoundException
patch - the Patch object whose status is to be queriedNotFoundException - if no commit status can be found for the provided patchdefault void destroy()
Copyright © 2016 JBoss by Red Hat. All rights reserved.