]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 - Added payload getClass method (for profiling and log)
authorStephane Gamard <stephane.gamard@searchbox.com>
Thu, 12 Jun 2014 17:18:00 +0000 (19:18 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Thu, 12 Jun 2014 17:19:44 +0000 (19:19 +0200)
sonar-server/src/main/java/org/sonar/server/search/action/DtoIndexAction.java
sonar-server/src/main/java/org/sonar/server/search/action/EmbeddedIndexAction.java
sonar-server/src/main/java/org/sonar/server/search/action/IndexAction.java
sonar-server/src/main/java/org/sonar/server/search/action/KeyIndexAction.java

index 0fb59e52bf2ce29d954867097cc6aa85a03129e5..d6d6eb2a952902332a4b1b924b1358d4669a349b 100644 (file)
@@ -30,6 +30,11 @@ public class DtoIndexAction<E extends Dto> extends IndexAction {
     this.item = item;
   }
 
+  @Override
+  public Class<?> getPayloadClass() {
+    return item.getClass();
+  }
+
   @Override
   public String getKey() {
     return item.getKey().toString();
index c0a4c554c7b555736d0473f9013108f86a7a163a..cdbccfcbd857703458b9ebdafce0a8a63180a96c 100644 (file)
@@ -39,6 +39,11 @@ public class EmbeddedIndexAction<K extends Serializable> extends IndexAction {
     return this.key.toString();
   }
 
+  @Override
+  public Class<?> getPayloadClass() {
+    return item.getClass();
+  }
+
   @Override
   public void doExecute() {
 
index c36463f849499147d9a7211fab592c1491b508d0..e8164cb049bbfc08989be7716b3d55e71859639a 100644 (file)
@@ -25,6 +25,8 @@ import org.sonar.server.search.Index;
 public abstract class IndexAction extends QueueAction {
 
 
+  public abstract Class<?> getPayloadClass();
+
   public enum Method {
     UPSERT, DELETE
   }
index 372a14a2748f531c7d037688e10d9a849fb25779..69ef59caf2db94b24336c584928459b5fb53857e 100644 (file)
@@ -30,6 +30,11 @@ public class KeyIndexAction<K extends Serializable> extends IndexAction {
     this.key = key;
   }
 
+  @Override
+  public Class<?> getPayloadClass() {
+    return String.class;
+  }
+
   @Override
   public String getKey() {
     return this.key.toString();