]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7692 restore JRubyFacade#indexResource as indexComponent
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 6 Jul 2016 08:36:56 +0000 (10:36 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 7 Jul 2016 15:06:59 +0000 (17:06 +0200)
this method is used by Developer Cockpit

server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java

index 0644d65efb2cf5ce67f85c658cd68ea77e593ea5..8760f480ac98d3053169def181f787b5390fa3a6 100644 (file)
@@ -46,6 +46,8 @@ import org.sonar.core.platform.PluginInfo;
 import org.sonar.core.platform.PluginRepository;
 import org.sonar.core.timemachine.Periods;
 import org.sonar.db.Database;
+import org.sonar.db.DbClient;
+import org.sonar.db.DbSession;
 import org.sonar.db.version.DatabaseMigration;
 import org.sonar.db.version.DatabaseVersion;
 import org.sonar.process.ProcessProperties;
@@ -351,6 +353,16 @@ public final class JRubyFacade {
     return !database.getDialect().supportsMigration();
   }
 
+  /**
+   * Used by Developer Cockpit
+   */
+  public void indexComponent(String componentUuid) {
+    DbClient dbClient = get(DbClient.class);
+    try (DbSession dbSession = dbClient.openSession(false)) {
+      dbClient.componentIndexDao().indexResource(dbSession, componentUuid);
+    }
+  }
+
   public List<IdentityProvider> getIdentityProviders(){
     return get(IdentityProviderRepository.class).getAllEnabledAndSorted();
   }