diff options
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java | 9 | ||||
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java b/server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java index 8724c4d7f89..d3c78fd2727 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java @@ -45,6 +45,7 @@ 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.component.ResourceIndexDao; import org.sonar.db.version.DatabaseMigration; import org.sonar.db.version.DatabaseVersion; import org.sonar.process.ProcessProperties; @@ -402,4 +403,12 @@ public final class JRubyFacade { Database database = container.getComponentByType(Database.class); return !database.getDialect().supportsMigration(); } + + /** + * Used by Developer Cockpit + */ + public void indexResource(long resourceId) { + get(ResourceIndexDao.class).indexResource(resourceId); + } + } diff --git a/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java b/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java index 83e06670edc..f9e38b12f74 100644 --- a/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java +++ b/sonar-db/src/main/java/org/sonar/db/component/ResourceIndexDao.java @@ -136,6 +136,15 @@ public class ResourceIndexDao extends AbstractDao { } } + public boolean indexResource(long id) { + DbSession session = myBatis().openSession(false); + try { + return indexResource(session, id); + } finally { + MyBatis.closeQuietly(session); + } + } + public boolean indexResource(DbSession session, long id) { boolean indexed = false; ResourceIndexMapper mapper = session.getMapper(ResourceIndexMapper.class); |