public class Aphrodite extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static String |
FILE_PROPERTY |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCommentToIssue(Collection<Issue> issues,
Comment comment)
Adds the
Comment to all of the provided Issue objects. |
void |
addCommentToIssue(Issue issue,
Comment comment)
Adds a new comment to the specified issue.
|
boolean |
addCommentToIssue(Map<Issue,Comment> commentMap)
Adds the
Comment to the associated Issue object for all Issue/Comment
pairs in the Map. |
void |
addCommentToPullRequest(PullRequest pullRequest,
String comment)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#addComment() instead. |
void |
addLabelToPullRequest(PullRequest pullRequest,
String labelName)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#addLabel() instead. |
void |
close() |
Issue |
createIssue(IssueCreationDetails details)
Create skeletal issue.
|
List<PullRequest> |
findPullRequestsRelatedTo(PullRequest pullRequest)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#findReferencedPullRequests() instead. |
List<PullRequest> |
findReferencedPullRequests(PullRequest pullRequest)
Return all the referenced PRs to a given PR using all the repositories
defined in the instance.
|
List<Stream> |
getAllStreams()
Returns the streams discovered by all of the active StreamServices
|
CommitStatus |
getCommitStatusFromPullRequest(PullRequest pullRequest)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#getCommitStatus() instead. |
StreamComponent |
getComponentBy(URI repository,
Codebase codebase)
Deprecated.
|
AphroditeConfig |
getConfig() |
List<URI> |
getDistinctURLRepositoriesByStream(String streamName)
Deprecated.
|
List<URI> |
getDistinctURLRepositoriesFromStreams()
Deprecated.
|
Issue |
getIssue(PullRequest pullRequest)
Deprecated.
|
Issue |
getIssue(URL url)
Retrieve an issue object associated with the given
URL. |
List<Issue> |
getIssues(Collection<URL> urls)
Retrieve all issues associated with the provided URLs.
|
List<Issue> |
getIssuesAssociatedWith(PullRequest pullRequest)
Deprecated.
|
List<Label> |
getLabelsFromPullRequest(PullRequest pullRequest)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#getLabels() instead. |
List<Label> |
getLabelsFromRepository(Repository repository)
Retrieve all labels associated with the provided
PullRequest in Repository object. |
PullRequest |
getPullRequest(URL url)
Get the
PullRequest located at the provided URL. |
List<PullRequest> |
getPullRequestsByState(Repository repository,
PullRequestState state)
Retrieve all PullRequests associated with the provided
Repository object, which have a
state that matches the provided PullRequestState object. |
PullRequestUpgrade |
getPullRequestUpgrade(PullRequest pullRequest)
Deprecated.
|
Map<RepositoryType,RateLimit> |
getRateLimits() |
List<Issue> |
getRelatedIssues(PullRequest pullRequest)
Deprecated.
|
Repository |
getRepository(URL url)
Get the repository located at the provided
URL. |
Stream |
getStream(String streamName)
Get a specific
Stream object based upon its String name. |
List<Stream> |
getStreamsBy(URI repository,
Codebase codebase)
Deprecated.
|
Issue |
getUpstreamIssue(PullRequest pullRequest)
Deprecated.
|
PullRequest |
getUpstreamPullRequest(PullRequest pullRequest)
Deprecated.
|
boolean |
hasUpgrade(PullRequest pullRequest)
Deprecated.
|
static Aphrodite |
instance()
Get an instance of the Aphrodite service.
|
static Aphrodite |
instance(AphroditeConfig config)
Get an instance of the Aphrodite service.
|
boolean |
isCPReleased(String cpVersion)
Check if a given CP version is released.
|
boolean |
isRepositoryLabelsModifiable(Repository repository)
Discover if the user logged into a
RepositoryService has the correct permissions to apply/remove
labels to pull request in the provided Repository |
boolean |
isUpstreamRequired(PullRequest pullRequest)
Deprecated.
|
void |
removeLabelFromPullRequest(PullRequest pullRequest,
String name)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#removeLabel() instead. |
List<Issue> |
searchIssues(SearchCriteria searchCriteria)
Return all issues, across all Issue Trackers, which match the passed
SearchCriteria. |
List<Issue> |
searchIssuesByFilter(URL filterUrl)
Return all issues which match the provided filter.
|
void |
setLabelsToPullRequest(PullRequest pullRequest,
List<Label> labels)
Deprecated.
Use
org.jboss.set.aphrodite.domain.spi.PullRequestHome#setLabels() instead. |
boolean |
updateIssue(Issue issue)
Update a specific
Issue at the remote issue tracker service. |
public static final String FILE_PROPERTY
public static Aphrodite instance() throws AphroditeException
AphroditeException - if the specified configuration file cannot be opened.public static Aphrodite instance(AphroditeConfig config) throws AphroditeException
IllegalStateException is thrown if a different AphroditeConfig object is passed.config - an AphroditeConfig object containing all configuration data.AphroditeException - if initialization failsIllegalStateException - if an Aphrodite service has already been initialised.public void close()
throws Exception
close in interface AutoCloseableExceptionpublic Issue getIssue(URL url) throws NotFoundException
URL.url - the URL of the issue to be retrieved.Issue associated with the provided URK.NotFoundException - if the provided URL is not associated with an issue at any of the active issuetrackers.public Issue createIssue(IssueCreationDetails details) throws NotFoundException, MalformedURLException
trackerURL - - URL of tracker in which issue should be createdprojectKey - - ID of project/productparameters - - parameters, differ for each tracker.NotFoundExceptionMalformedURLException@Deprecated public Issue getIssue(PullRequest pullRequest) throws NotFoundException, MalformedURLException
pullRequest - - PR which will be interrogated.NotFoundException - - if there is linked issue but either no tracker or issue does not exist in trackerMalformedURLException@Deprecated public List<Issue> getRelatedIssues(PullRequest pullRequest) throws MalformedURLException, NotFoundException
pullRequest - - PR which will be interrogated.NotFoundException - - if there is linked issue but either no tracker or issue does not exist in trackerMalformedURLException@Deprecated public Issue getUpstreamIssue(PullRequest pullRequest) throws NotFoundException, MalformedURLException
pullRequest - - PR which will be interrogated.isUpstreamRequired(PullRequest) return false;
NotFoundException - - if there is linked issue but either no tracker or issue does not exist in trackerMalformedURLException@Deprecated public PullRequest getUpstreamPullRequest(PullRequest pullRequest) throws MalformedURLException, NotFoundException
pullRequest - - PR which will be interrogated.isUpstreamRequired(PullRequest) return false;
NotFoundException - - if there is linked PR but either no tracker or issue does not exist in trackerMalformedURLException@Deprecated public PullRequestUpgrade getPullRequestUpgrade(PullRequest pullRequest)
@Deprecated public boolean isUpstreamRequired(PullRequest pullRequest)
pullRequest - @Deprecated public boolean hasUpgrade(PullRequest pullRequest)
pullRequest - public List<Issue> getIssues(Collection<URL> urls)
IssueTrackerServer. If the provided URLs
collection is empty, or no issues are found, then an empty List is returned.urls - a collection of issue URLs.Issue objects associated with the provided urls.public List<Issue> searchIssues(SearchCriteria searchCriteria)
SearchCriteria.searchCriteria - all set fields will be search for.Issue objects which match the specified searchCriteria,
or an empty list if no issues match the searched criteria.public List<Issue> searchIssuesByFilter(URL filterUrl) throws NotFoundException
filterUrl - the url of the issue tracker filtered to be applied.Issue objects which are returned by the provided filter.NotFoundException - if the filterURL is not associated with any filters at any of the Issue Trackers.public boolean updateIssue(Issue issue) throws NotFoundException, AphroditeException
Issue at the remote issue tracker service.
Note, this does not update issue comments or an issues description.
To add a new comment, use addCommentToIssue(Issue, Comment)issue - the issue to be updated at the associated IssueTrackerServiceNotFoundException - if the provided Issue cannot be found at the IssueTracker.AphroditeException - if the user credentials supplied for this issue track do not have
permission to update this issue, or a field within this issue.public void addCommentToIssue(Issue issue, Comment comment) throws NotFoundException
issue - the issue to add a new comment to.comment - the comment to be added to the issue.NotFoundExceptionpublic boolean addCommentToIssue(Map<Issue,Comment> commentMap)
Comment to the associated Issue object for all Issue/Comment
pairs in the Map. Null comments are ignored.commentMap - the map containing all Issues that are to be updated and the associated comments.public boolean addCommentToIssue(Collection<Issue> issues, Comment comment)
Comment to all of the provided Issue objects.issues - a collection of all issues that the comment should be added to.comment - the comment to be added to all issues.@Deprecated public List<Issue> getIssuesAssociatedWith(PullRequest pullRequest)
pullRequest - the PullRequest object whoms associated Issues should be returned.Issue objects, or an empty list if no issues can be found.public 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,
or no service exists with the same host domain as the provided URL.public List<PullRequest> getPullRequestsByState(Repository repository, PullRequestState state) throws NotFoundException
Repository object, which have a
state that matches the provided PullRequestState object.repository - the Repository object whose associated PullRequests should be returned.state - the PullRequestState which the returned PullRequest objects must have.PullRequest objects, or an empty list if no pullRequests can be found.NotFoundException - if an exception is encountered when trying to retrieve pullRequests from a RepositoryServicepublic PullRequest getPullRequest(URL url) throws NotFoundException
PullRequest located at the provided URL.url - the URL of the pullRequest to be retrieved.PullRequest object.NotFoundException - if a PullRequest cannot be found at the provided base url.public Map<RepositoryType,RateLimit> getRateLimits() throws NotFoundException
NotFoundExceptionpublic List<Label> getLabelsFromRepository(Repository repository) throws NotFoundException
PullRequest in Repository object.repository - the Repository object whose associated labels should be returned.Label objects, or an empty list if no labels can be found.NotFoundException - if an error is encountered when trying to retrieve labels from a RepositoryService@Deprecated public List<Label> getLabelsFromPullRequest(PullRequest pullRequest) throws NotFoundException
org.jboss.set.aphrodite.domain.spi.PullRequestHome#getLabels() instead.PullRequest object.pullRequest - request the PullRequest object whose associated labels should be returned.Label objects, or an empty list if no pull request can be found.NotFoundException - if an error is encountered when trying to retrieve labels from a RepositoryServicepublic boolean isRepositoryLabelsModifiable(Repository repository) throws NotFoundException
RepositoryService has the correct permissions to apply/remove
labels to pull request in the provided Repositoryrepository - the Repository whose permissions are to be checkedNotFoundException - if the specified Repository cannot be found.@Deprecated public void setLabelsToPullRequest(PullRequest pullRequest, List<Label> labels) throws NotFoundException, AphroditeException
org.jboss.set.aphrodite.domain.spi.PullRequestHome#setLabels() instead.PullRequest object.pullRequest - the PullRequest object whose will be set.labels - the Label apply to the PullRequestNotFoundException - if the Label can not be found in the provided PullRequestAphroditeException - if add the Label is not consistent with get labels@Deprecated public void removeLabelFromPullRequest(PullRequest pullRequest, String name) throws NotFoundException
org.jboss.set.aphrodite.domain.spi.PullRequestHome#removeLabel() instead.PullRequest object.pullRequest - the PullRequest whose label will be removed.name - the Label name will be removed.NotFoundException - if the Label name can not be found in the provided PullRequest, or an
exception occurs when contacting the RepositoryService@Deprecated public void addCommentToPullRequest(PullRequest pullRequest, String comment) throws NotFoundException
org.jboss.set.aphrodite.domain.spi.PullRequestHome#addComment() instead.Comment to the specified PullRequest object, and propagate the changes
to the remote repository.pullRequest - the PullRequest on which the comment will be made.comment - the new Comment.NotFoundException - if the PullRequest cannot be found at the remote repository.@Deprecated public void addLabelToPullRequest(PullRequest pullRequest, String labelName) throws NotFoundException
org.jboss.set.aphrodite.domain.spi.PullRequestHome#addLabel() instead.pullRequest - the PullRequest to which the label will be applied.labelName - the name of the label to be applied.NotFoundException - if the PullRequest cannot be found, or the labelName does not exist.@Deprecated public List<PullRequest> findPullRequestsRelatedTo(PullRequest pullRequest)
org.jboss.set.aphrodite.domain.spi.PullRequestHome#findReferencedPullRequests() instead.PullRequest objects related to the supplied pull request. A pull request is related if its URL is referenced in the
provided pull request object. Note, this method fails silently if a pull request cannot be retrieved from a URL, with the error message
simply logged.pullRequest - request the PullRequest object to be queried against@Deprecated public CommitStatus getCommitStatusFromPullRequest(PullRequest pullRequest) throws NotFoundException
org.jboss.set.aphrodite.domain.spi.PullRequestHome#getCommitStatus() instead.pullRequest - the PullRequest object whose status is to be queriedNotFoundException - if no commit status can be found for the provided pull requestpublic List<Stream> getAllStreams()
StreamService instances.public Stream getStream(String streamName) throws NotFoundException
Stream object based upon its String name.streamName - the name of the Stream to be returned.Stream object which corresponds to the specified streamName
if it exists at a StreamService.NotFoundException - if the specified streamName does not exist at any of the loaded StreamServices.public boolean isCPReleased(String cpVersion)
cpVersion - the CP version to be tested. Jira accepts GA version format x.y.z.GA, e.g. 7.1.2.GA. Bugzilla accepts version format x.y.z, e.g. 6.4.18.@Deprecated public List<URI> getDistinctURLRepositoriesFromStreams()
@Deprecated public List<URI> getDistinctURLRepositoriesByStream(String streamName)
streamName - the name of the Stream containing the returned repositories.@Deprecated public List<Stream> getStreamsBy(URI repository, Codebase codebase)
repository - the Repository to be searched againstcodebase - the codebase to be searched against@Deprecated public StreamComponent getComponentBy(URI repository, Codebase codebase) throws NotFoundException
repository - the Repository to be searched against.codebase - the codebase to be searched against.NotFoundException - if a StreamComponent with the specified repository and codebase does not exist at this
stream service.public AphroditeConfig getConfig()
public List<PullRequest> findReferencedPullRequests(PullRequest pullRequest)
pullRequest - The PR to obtain the references PRsCopyright © 2020 JBoss by Red Hat. All rights reserved.