diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-06-19 08:28:09 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-06-19 08:28:09 +0200 |
commit | 07d0c8f4bfd48c84d9dff39c1f69892e5a1dcc38 (patch) | |
tree | b1a0ea4511dfd0889e8e2b9b9c2d0dc2655db962 /sonar-ws-client/src/main/java/org | |
parent | bdb21c18c2ac04c2f3664260a04ee9ba6b93a988 (diff) | |
download | sonarqube-07d0c8f4bfd48c84d9dff39c1f69892e5a1dcc38.tar.gz sonarqube-07d0c8f4bfd48c84d9dff39c1f69892e5a1dcc38.zip |
SONAR-4383 Add WS to execute issue filter
Diffstat (limited to 'sonar-ws-client/src/main/java/org')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java | 7 | ||||
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java index 1e1fd52df4f..96a7fb08294 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/IssueClient.java @@ -36,6 +36,13 @@ public interface IssueClient { Issues find(IssueQuery query); /** + * Wrap the web service /api/issues/filter in order to execute issue filter. + * + * @since 3.7 + */ + Issues filter(String filterId); + + /** * Assign an existing issue to a user. A null assignee removes the assignee. * * @return the updated issue diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java index c4b2f326555..030b3ea2323 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/issue/internal/DefaultIssueClient.java @@ -25,6 +25,7 @@ import org.sonar.wsclient.internal.HttpRequestFactory; import org.sonar.wsclient.issue.*; import javax.annotation.Nullable; + import java.util.List; import java.util.Map; @@ -43,12 +44,20 @@ public class DefaultIssueClient implements IssueClient { this.parser = new IssueJsonParser(); } + @Override public Issues find(IssueQuery query) { String json = requestFactory.get(SEARCH_URL, query.urlParams()); return parser.parseIssues(json); } @Override + public Issues filter(String filterId) { + Map<String, Object> queryParams = EncodingUtils.toMap("filter", filterId); + String json = requestFactory.get("/api/issues/filter", queryParams); + return parser.parseIssues(json); + } + + @Override public Issue create(NewIssue newIssue) { String json = requestFactory.post("/api/issues/create", newIssue.urlParams()); return jsonToIssue(json); |