aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch-protocol/src/main
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-09-17 10:41:56 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-09-30 16:27:12 +0200
commit5af4d8ed1fe0ad9fc75bdf9aaf01410b66c4da5f (patch)
treeff0b296f7ae1cf3817bd6c82d0bce8ed2388f159 /sonar-batch-protocol/src/main
parentf728687b5cf55977ce241695097b8e01418988e3 (diff)
downloadsonarqube-5af4d8ed1fe0ad9fc75bdf9aaf01410b66c4da5f.tar.gz
sonarqube-5af4d8ed1fe0ad9fc75bdf9aaf01410b66c4da5f.zip
SONAR-6823 WS batch/project with protobuf and new behaviors
Diffstat (limited to 'sonar-batch-protocol/src/main')
-rw-r--r--sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java14
-rw-r--r--sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java37
2 files changed, 25 insertions, 26 deletions
diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java
index 28b8083c0e2..6fb54002ab0 100644
--- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java
+++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/FileData.java
@@ -25,11 +25,11 @@ import javax.annotation.Nullable;
public class FileData {
private final String hash;
- private final boolean needBlame;
+ private final String revision;
- public FileData(@Nullable String hash, boolean needBlame) {
+ public FileData(@Nullable String hash, @Nullable String revision) {
this.hash = hash;
- this.needBlame = needBlame;
+ this.revision = revision;
}
@CheckForNull
@@ -37,8 +37,12 @@ public class FileData {
return hash;
}
- public boolean needBlame() {
- return needBlame;
+ @CheckForNull
+ public String revision() {
+ return revision;
}
+ public boolean needBlame() {
+ return false;
+ }
}
diff --git a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java
index 862a21152d8..fdcfb0fe3f6 100644
--- a/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java
+++ b/sonar-batch-protocol/src/main/java/org/sonar/batch/protocol/input/ProjectRepositories.java
@@ -36,8 +36,6 @@ import org.sonar.batch.protocol.GsonHelper;
public class ProjectRepositories {
private long timestamp;
- private Map<String, QProfile> qprofilesByLanguage = new HashMap<>();
- private Collection<ActiveRule> activeRules = new ArrayList<>();
private Map<String, Map<String, String>> settingsByModule = new HashMap<>();
private Map<String, Map<String, FileData>> fileDataByModuleAndPath = new HashMap<>();
private Date lastAnalysisDate;
@@ -45,7 +43,7 @@ public class ProjectRepositories {
public Map<String, String> settings(String moduleKey) {
return settingsByModule.containsKey(moduleKey) ? settingsByModule.get(moduleKey) : Collections.<String, String>emptyMap();
}
-
+
public Map<String, Map<String, String>> settings() {
return settingsByModule;
}
@@ -60,24 +58,6 @@ public class ProjectRepositories {
return this;
}
- public Collection<QProfile> qProfiles() {
- return qprofilesByLanguage.values();
- }
-
- public ProjectRepositories addQProfile(QProfile qProfile) {
- qprofilesByLanguage.put(qProfile.language(), qProfile);
- return this;
- }
-
- public Collection<ActiveRule> activeRules() {
- return activeRules;
- }
-
- public ProjectRepositories addActiveRule(ActiveRule activeRule) {
- activeRules.add(activeRule);
- return this;
- }
-
public Map<String, Map<String, FileData>> fileDataByModuleAndPath() {
return fileDataByModuleAndPath;
}
@@ -126,4 +106,19 @@ public class ProjectRepositories {
return GsonHelper.create().fromJson(json, ProjectRepositories.class);
}
+ public Collection<QProfile> qProfiles() {
+ return new ArrayList<>();
+ }
+
+ public Collection<ActiveRule> activeRules() {
+ return new ArrayList<>();
+ }
+
+ public void addQProfile(QProfile qProfile) {
+ // do nothing
+ }
+
+ public void addActiveRule(ActiveRule activeRule) {
+ // do nothing
+ }
}