aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-06-19 15:03:07 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-06-19 16:17:50 +0200
commit8fd70f1a365ccddc8f77bd2fa2959cce833c2106 (patch)
tree295dc0551b8024cabcc87f563ec6bbb36101ee98 /sonar-core
parent688ff25bb43440110fccc6b3c4b74f5891268e3f (diff)
downloadsonarqube-8fd70f1a365ccddc8f77bd2fa2959cce833c2106.tar.gz
sonarqube-8fd70f1a365ccddc8f77bd2fa2959cce833c2106.zip
SONAR-5329 - Updated base Activity Beans
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/activity/Activity.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java18
3 files changed, 23 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/activity/Activity.java b/sonar-core/src/main/java/org/sonar/core/activity/Activity.java
index fac77c44e0d..da16111b6b6 100644
--- a/sonar-core/src/main/java/org/sonar/core/activity/Activity.java
+++ b/sonar-core/src/main/java/org/sonar/core/activity/Activity.java
@@ -28,7 +28,7 @@ import java.util.Map;
public interface Activity {
public static enum Type {
- NONE, ACTIVE_RULE, SERVER
+ NONE, ACTIVE_RULE, SERVER, QPROFILE
}
Date time();
diff --git a/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java b/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java
index eae04476a95..1fc41871743 100644
--- a/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java
+++ b/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java
@@ -28,4 +28,8 @@ public interface ActivityLog {
Map<String, String> getDetails();
+ public String getAction();
+
+ public String getMessage();
+
}
diff --git a/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java b/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java
index 4427c45e8e2..fa0006c823d 100644
--- a/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java
@@ -33,6 +33,7 @@ public final class ActivityDto extends Dto<ActivityKey> {
private String message;
private Activity.Type type;
+ private String action;
private String author;
private String data;
@@ -90,13 +91,30 @@ public final class ActivityDto extends Dto<ActivityKey> {
return this;
}
+ public String getAction() {
+ return action;
+ }
+
+ public ActivityDto setAction(String action) {
+ this.action = action;
+ return this;
+ }
+
public static ActivityDto createFor(String message) {
return new ActivityDto()
.setMessage(message);
}
+ public static ActivityDto createFor(String action, String message) {
+ return new ActivityDto()
+ .setAction(action)
+ .setMessage(message);
+ }
+
public static ActivityDto createFor(ActivityLog activityLog) {
return new ActivityDto()
+ .setMessage(activityLog.getMessage())
+ .setAction(activityLog.getAction())
.setData(KeyValueFormat.format(activityLog.getDetails()));
}
}