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 |
addCommentToPullRequest(PullRequest pullRequest,
String comment)
Add a
Comment to the specified PullRequest object, and propagate the changes
to the remote repository. |
protected void |
checkHost(URL url) |
String |
createFromId(String id) |
String |
createFromUrl(URL url) |
protected abstract org.apache.commons.logging.Log |
getLog() |
PullRequest |
getPullRequest(URL url)
Get the
PullRequest located at the provided URL. |
List<PullRequest> |
getPullRequestsAssociatedWith(Issue issue)
Retrieve all pull requests associated with the provided
Issue object |
List<PullRequest> |
getPullRequestsByState(Repository repository,
PullRequestState state)
Retrieve all pull requests associated with the provided
Repository object, which have a
state that matches the provided PullRequestState object. |
RateLimit |
getRateLimit() |
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, waitaddLabelToPullRequest, destroy, findPullRequestsRelatedTo, getCommitStatusFromPullRequest, getLabelsFromPullRequest, getLabelsFromRepository, getRepositoryType, hasModifiableLabels, removeLabelFromPullRequest, repositoryAccessable, setLabelsToPullRequestprotected 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 PullRequest getPullRequest(URL url) throws NotFoundException
RepositoryServicePullRequest located at the provided URL.getPullRequest in interface RepositoryServiceurl - the URL of the pull request to be retrieved.PullRequest object.NotFoundException - if a PullRequest cannot be found at the provided base url.public List<PullRequest> getPullRequestsAssociatedWith(Issue issue) throws NotFoundException
RepositoryServiceIssue objectgetPullRequestsAssociatedWith in interface RepositoryServiceissue - the Issue object whose associated pull requests should be returned.PullRequest objects, or an empty list if no pull request can be found.NotFoundException - if an exception is thrown when searching the RepositoryService.public List<PullRequest> getPullRequestsByState(Repository repository, PullRequestState state) throws NotFoundException
RepositoryServiceRepository object, which have a
state that matches the provided PullRequestState object.getPullRequestsByState in interface RepositoryServicerepository - the Repository object whose associated pull requests should be returned.state - the PullRequestsState which the returned PullRequest objects must have.PullRequest objects, or an empty list if no pull request can be found.NotFoundException - if the provided Repository cannot be found at the RepositoryService.public RateLimit getRateLimit() throws NotFoundException
getRateLimit in interface RepositoryServiceNotFoundExceptionpublic void addCommentToPullRequest(PullRequest pullRequest, String comment) throws NotFoundException
RepositoryServiceComment to the specified PullRequest object, and propagate the changes
to the remote repository.addCommentToPullRequest in interface RepositoryServicepullRequest - the PullRequest on which the comment will be made.comment - the new Comment.NotFoundException - if the PullRequest 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 © 2017 JBoss by Red Hat. All rights reserved.