aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-05-22 11:17:01 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-05-22 11:17:01 +0200
commit70b2098567fea4cd5619aa81b3757c7a8172088c (patch)
tree9a441bbf90be133c2efeff3aa3d2c3b79f5fcf84 /sonar-plugin-api/src
parentac076a048acaadc3945b76da6ad282c60fcd7096 (diff)
downloadsonarqube-70b2098567fea4cd5619aa81b3757c7a8172088c.tar.gz
sonarqube-70b2098567fea4cd5619aa81b3757c7a8172088c.zip
SONAR-4301 Update IssueFinder to first retreive authorized root projects for user and then search for authorized issues based on issue query. Also add project in Issue.
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java9
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java11
3 files changed, 20 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java
index 42a38bf4190..36bf2abc812 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java
@@ -50,6 +50,8 @@ public interface Issue extends Serializable {
String componentKey();
+ String projectKey();
+
RuleKey ruleKey();
String severity();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java
index 158cba4c329..74edf09d6ec 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQuery.java
@@ -22,6 +22,7 @@ package org.sonar.api.issue;
import com.google.common.base.Preconditions;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.sonar.api.rule.RuleKey;
+import org.sonar.api.web.UserRole;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -36,6 +37,7 @@ public class IssueQuery {
public static final int DEFAULT_PAGE_INDEX = 1;
public static final int DEFAULT_PAGE_SIZE = 100;
+ public static final int MAX_RESULTS = 5000;
public static final int MAX_PAGE_SIZE = 500;
public static final int MAX_ISSUE_KEYS = 500;
@@ -174,7 +176,10 @@ public class IssueQuery {
return pageIndex;
}
- @CheckForNull
+ public int maxResults() {
+ return MAX_RESULTS;
+ }
+
public String requiredRole() {
return requiredRole;
}
@@ -208,7 +213,7 @@ public class IssueQuery {
private Boolean asc = false;
private Integer pageSize;
private Integer pageIndex;
- private String requiredRole;
+ private String requiredRole = UserRole.CODEVIEWER;
private Builder() {
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java
index b40991195ff..4a710cecaa6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/IssueQueryResult.java
@@ -25,6 +25,7 @@ import org.sonar.api.user.User;
import org.sonar.api.utils.Paging;
import javax.annotation.CheckForNull;
+
import java.util.Collection;
import java.util.List;
@@ -48,6 +49,14 @@ public interface IssueQueryResult {
*/
Collection<Component> components();
+ Component project(Issue issue);
+
+ /**
+ * The projects involved in the paginated {@link #issues()}.
+ */
+ Collection<Component> projects();
+
+
@CheckForNull
ActionPlan actionPlan(Issue issue);
@@ -65,4 +74,6 @@ public interface IssueQueryResult {
Paging paging();
boolean securityExclusions();
+
+ boolean maxResultsReached();
}