From 1c623f97a76734a13224832da38cfa1721d03abe Mon Sep 17 00:00:00 2001
From: =?utf8?q?S=C3=A9bastien=20Lesaint?=
Date: Wed, 23 Mar 2016 10:14:22 +0100
Subject: [PATCH] SONAR-7441 add ComputeEngineSide annotation where applicable
---
.../container/ComputeEngineContainerImpl.java | 3 +--
.../ComputeEngineContainerImplTest.java | 2 +-
.../java/org/sonar/ce/queue/CeQueueImpl.java | 4 ++--
.../sonar/ce/queue/report/ReportFiles.java | 4 ++--
.../ce/queue/report/ReportSubmitter.java | 10 ++++----
.../component/ComponentCleanerService.java | 2 ++
.../server/component/ComponentService.java | 2 ++
.../computation/dbcleaner/ProjectCleaner.java | 2 ++
.../computation/queue/CeQueueCleaner.java | 4 ++--
.../computation/queue/CeQueueInitializer.java | 5 ++--
.../queue/InternalCeQueueImpl.java | 4 ++--
.../computation/queue/PurgeCeActivities.java | 8 +++----
.../debt/DebtModelPluginRepository.java | 3 ++-
.../server/debt/DebtRulesXMLImporter.java | 2 ++
.../java/org/sonar/server/es/BaseIndex.java | 2 ++
.../server/issue/IssueChangelogService.java | 2 ++
.../sonar/server/issue/IssueQueryService.java | 2 ++
.../org/sonar/server/issue/IssueService.java | 2 ++
.../org/sonar/server/issue/IssueUpdater.java | 2 ++
.../NewIssuesNotificationFactory.java | 2 ++
.../issue/workflow/FunctionExecutor.java | 2 ++
.../server/issue/workflow/IssueWorkflow.java | 2 ++
.../notification/NotificationDispatcher.java | 2 ++
.../NotificationDispatcherMetadata.java | 2 ++
.../notification/NotificationService.java | 2 ++
.../sonar/server/platform/ServerLogging.java | 2 ++
.../server/platform/monitoring/Monitor.java | 2 ++
.../plugins/ServerPluginJarExploder.java | 2 ++
.../properties/ProjectSettingsFactory.java | 2 ++
.../qualityprofile/BuiltInProfiles.java | 5 ++--
.../qualityprofile/QProfileComparison.java | 2 ++
.../server/qualityprofile/QProfileLookup.java | 2 ++
.../qualityprofile/QProfileProjectLookup.java | 13 +++++-----
.../QProfileProjectOperations.java | 2 ++
.../rule/DeprecatedRulesDefinitionLoader.java | 2 ++
.../sonar/server/rule/RuleRepositories.java | 12 +++++-----
.../sonar/server/user/index/UserIndex.java | 16 ++++++-------
.../sonar/server/view/index/ViewIndex.java | 7 +++---
.../core/component/DefaultResourceTypes.java | 2 ++
.../java/org/sonar/core/i18n/DefaultI18n.java | 2 ++
.../org/sonar/core/i18n/RuleI18nManager.java | 2 ++
.../org/sonar/core/metric/BatchMetrics.java | 4 ++--
.../core/platform/ComponentContainer.java | 2 ++
.../platform/PluginClassloaderFactory.java | 2 ++
.../sonar/core/platform/PluginRepository.java | 2 ++
.../org/sonar/db/issue/IssueChangeDao.java | 2 ++
.../db/measure/custom/CustomMeasureDao.java | 2 ++
.../db/permission/PermissionRepository.java | 2 ++
.../db/purge/period/DefaultPeriodCleaner.java | 2 ++
.../db/qualityprofile/QualityProfileDao.java | 2 ++
.../org/sonar/db/user/AuthorizationDao.java | 2 ++
.../src/main/java/org/sonar/api/Plugin.java | 6 +++--
.../java/org/sonar/api/ServerComponent.java | 2 +-
.../java/org/sonar/api/ServerExtension.java | 3 ++-
.../java/org/sonar/api/SonarQubeVersion.java | 2 ++
.../sonar/api/ce/measure/MeasureComputer.java | 4 ++--
.../org/sonar/api/config/EmailSettings.java | 4 +++-
.../sonar/api/config/PropertyDefinition.java | 16 ++++++-------
.../sonar/api/config/PropertyDefinitions.java | 18 +++++++-------
.../java/org/sonar/api/config/Settings.java | 16 ++++++-------
.../main/java/org/sonar/api/i18n/I18n.java | 10 ++++----
.../java/org/sonar/api/i18n/RuleI18n.java | 10 ++++----
.../java/org/sonar/api/measures/Metric.java | 2 ++
.../org/sonar/api/measures/MetricFinder.java | 10 ++++----
.../java/org/sonar/api/measures/Metrics.java | 9 +++----
.../notifications/NotificationChannel.java | 2 ++
.../java/org/sonar/api/platform/Server.java | 2 ++
.../sonar/api/platform/ServerFileSystem.java | 5 ++--
.../api/platform/ServerStartHandler.java | 2 ++
.../sonar/api/platform/ServerStopHandler.java | 2 ++
.../api/platform/ServerUpgradeStatus.java | 2 ++
.../api/profiles/AnnotationProfileParser.java | 7 +++---
.../sonar/api/profiles/ProfileImporter.java | 3 +--
.../sonar/api/profiles/XMLProfileParser.java | 2 ++
.../api/profiles/XMLProfileSerializer.java | 9 +++----
.../org/sonar/api/resources/Language.java | 6 +++--
.../org/sonar/api/resources/Languages.java | 13 +++++-----
.../sonar/api/resources/ResourceTypeTree.java | 7 +++---
.../sonar/api/resources/ResourceTypes.java | 2 ++
.../sonar/api/rules/AnnotationRuleParser.java | 9 +++----
.../java/org/sonar/api/rules/RuleFinder.java | 10 ++++----
.../org/sonar/api/rules/RuleRepository.java | 5 ++--
.../org/sonar/api/rules/XMLRuleParser.java | 24 +++++++++----------
.../org/sonar/api/security/UserFinder.java | 2 ++
.../java/org/sonar/api/server/ServerSide.java | 2 +-
.../org/sonar/api/server/debt/DebtModel.java | 5 ++--
.../api/server/rule/RulesDefinition.java | 2 ++
.../rule/RulesDefinitionI18nLoader.java | 4 +++-
.../server/rule/RulesDefinitionXmlLoader.java | 2 ++
.../java/org/sonar/api/user/UserFinder.java | 2 ++
.../java/org/sonar/api/utils/Durations.java | 2 ++
.../java/org/sonar/api/utils/System2.java | 2 ++
.../java/org/sonar/api/utils/TempFolder.java | 8 +++----
.../java/org/sonar/api/utils/UriReader.java | 7 +++---
94 files changed, 278 insertions(+), 158 deletions(-)
diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
index ef095ab7de7..ca6cc5bc496 100644
--- a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
+++ b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
@@ -23,7 +23,6 @@ import com.google.common.annotations.VisibleForTesting;
import java.util.List;
import javax.annotation.CheckForNull;
import org.sonar.api.config.EmailSettings;
-import org.sonar.api.issue.action.Actions;
import org.sonar.api.profiles.AnnotationProfileParser;
import org.sonar.api.profiles.XMLProfileParser;
import org.sonar.api.profiles.XMLProfileSerializer;
@@ -428,7 +427,7 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer {
// InternalRubyIssueService.class, indirectly used only in Web Services
// IssueChangelogService.class, indirectly used only in Web Services
// ActionService.class, indirectly used only in Web Services
- Actions.class,
+ // Actions.class, long time deprecated and does not make sense to use it in any Component loaded in the CE
// IssueBulkChangeService.class, indirectly used only in Web Services
// WsResponseCommonFormat.class, indirectly used only in Web Services
// IssueWsModule.class, no Web Service in CE
diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
index d767f42a1bb..4b071c4c72d 100644
--- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
+++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
@@ -79,7 +79,7 @@ public class ComputeEngineContainerImplTest {
assertThat(picoContainer.getComponentAdapters())
.hasSize(
CONTAINER_ITSELF
- + 78 // level 4
+ + 77 // level 4
+ 5 // content of CeModule
+ 7 // content of CeQueueModule
+ 4 // content of ReportProcessingModule
diff --git a/server/sonar-server/src/main/java/org/sonar/ce/queue/CeQueueImpl.java b/server/sonar-server/src/main/java/org/sonar/ce/queue/CeQueueImpl.java
index 7aa61ad53ad..63adafa270c 100644
--- a/server/sonar-server/src/main/java/org/sonar/ce/queue/CeQueueImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/ce/queue/CeQueueImpl.java
@@ -30,7 +30,7 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.core.util.UuidFactory;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
@@ -43,7 +43,7 @@ import static com.google.common.base.Predicates.notNull;
import static com.google.common.collect.FluentIterable.from;
import static org.sonar.db.component.ComponentDtoFunctions.toUuid;
-@ServerSide
+@ComputeEngineSide
public class CeQueueImpl implements CeQueue {
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportFiles.java b/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportFiles.java
index 7efca8e9def..223a88ced21 100644
--- a/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportFiles.java
+++ b/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportFiles.java
@@ -28,12 +28,12 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.sonar.api.config.Settings;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.process.ProcessProperties;
import static java.lang.String.format;
-@ServerSide
+@ComputeEngineSide
public class ReportFiles {
private static final String ZIP_EXTENSION = "zip";
diff --git a/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportSubmitter.java b/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportSubmitter.java
index e3f357fd076..aa3536f237c 100644
--- a/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportSubmitter.java
+++ b/server/sonar-server/src/main/java/org/sonar/ce/queue/report/ReportSubmitter.java
@@ -23,21 +23,21 @@ import java.io.InputStream;
import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.ce.queue.CeQueue;
+import org.sonar.ce.queue.CeTask;
+import org.sonar.ce.queue.CeTaskSubmit;
import org.sonar.core.component.ComponentKeys;
import org.sonar.db.ce.CeTaskTypes;
import org.sonar.db.component.ComponentDto;
import org.sonar.server.component.ComponentService;
import org.sonar.server.component.NewComponent;
-import org.sonar.ce.queue.CeQueue;
-import org.sonar.ce.queue.CeTask;
-import org.sonar.ce.queue.CeTaskSubmit;
import org.sonar.server.permission.PermissionService;
import org.sonar.server.user.UserSession;
import static org.sonar.core.permission.GlobalPermissions.SCAN_EXECUTION;
-@ServerSide
+@ComputeEngineSide
public class ReportSubmitter {
private final CeQueue queue;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java
index 4b768c9bf46..8d75008845b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java
@@ -23,6 +23,7 @@ import java.util.List;
import org.sonar.api.resources.ResourceType;
import org.sonar.api.resources.ResourceTypes;
import org.sonar.api.resources.Scopes;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
@@ -33,6 +34,7 @@ import org.sonar.server.issue.index.IssueIndexer;
import org.sonar.server.test.index.TestIndexer;
@ServerSide
+@ComputeEngineSide
public class ComponentCleanerService {
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java
index 147145edc06..3329cebd8e6 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentService.java
@@ -33,6 +33,7 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.sonar.api.i18n.I18n;
import org.sonar.api.resources.Scopes;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
@@ -50,6 +51,7 @@ import static com.google.common.collect.Lists.newArrayList;
import static org.sonar.db.component.ComponentDtoFunctions.toKey;
@ServerSide
+@ComputeEngineSide
public class ComponentService {
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/dbcleaner/ProjectCleaner.java b/server/sonar-server/src/main/java/org/sonar/server/computation/dbcleaner/ProjectCleaner.java
index 45fc5625488..6973505b1d3 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/dbcleaner/ProjectCleaner.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/dbcleaner/ProjectCleaner.java
@@ -23,6 +23,7 @@ import java.util.Date;
import javax.annotation.Nullable;
import org.sonar.api.CoreProperties;
import org.sonar.api.config.Settings;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.TimeUtils;
import org.sonar.api.utils.log.Logger;
@@ -39,6 +40,7 @@ import org.sonar.server.issue.index.IssueIndex;
import static org.sonar.db.purge.PurgeConfiguration.newDefaultPurgeConfiguration;
@ServerSide
+@ComputeEngineSide
public class ProjectCleaner {
private static final Logger LOG = Loggers.get(ProjectCleaner.class);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueCleaner.java b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueCleaner.java
index 339eb7127ca..b7e644a8558 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueCleaner.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueCleaner.java
@@ -22,7 +22,7 @@ package org.sonar.server.computation.queue;
import java.util.HashSet;
import java.util.Set;
import org.sonar.api.platform.ServerUpgradeStatus;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.ce.queue.report.ReportFiles;
@@ -35,7 +35,7 @@ import org.sonar.db.ce.CeTaskTypes;
* Cleans-up the Compute Engine queue and resets the JMX counters.
* CE workers must not be started before execution of this class.
*/
-@ServerSide
+@ComputeEngineSide
public class CeQueueCleaner {
private static final Logger LOGGER = Loggers.get(CeQueueCleaner.class);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueInitializer.java b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueInitializer.java
index eaa67a7fc5d..060479d4c12 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueInitializer.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/CeQueueInitializer.java
@@ -21,7 +21,8 @@ package org.sonar.server.computation.queue;
import org.sonar.api.platform.Server;
import org.sonar.api.platform.ServerStartHandler;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.ce.monitoring.CEQueueStatus;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.server.computation.taskprocessor.CeProcessingScheduler;
@@ -31,7 +32,7 @@ import org.sonar.server.computation.taskprocessor.CeProcessingScheduler;
* the execution of workers. That allows to not prevent workers
* from peeking the queue before it's ready.
*/
-@ServerSide
+@ComputeEngineSide
public class CeQueueInitializer implements ServerStartHandler {
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/InternalCeQueueImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/InternalCeQueueImpl.java
index 3e0f988270a..7ffe4ddf840 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/InternalCeQueueImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/InternalCeQueueImpl.java
@@ -22,7 +22,7 @@ package org.sonar.server.computation.queue;
import com.google.common.base.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.utils.System2;
import org.sonar.ce.monitoring.CEQueueStatus;
import org.sonar.ce.queue.CeQueueImpl;
@@ -37,7 +37,7 @@ import org.sonar.db.ce.CeQueueDto;
import static java.lang.String.format;
-@ServerSide
+@ComputeEngineSide
public class InternalCeQueueImpl extends CeQueueImpl implements InternalCeQueue {
private final System2 system2;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/PurgeCeActivities.java b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/PurgeCeActivities.java
index 690fc23759a..8d69f1b293b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/queue/PurgeCeActivities.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/queue/PurgeCeActivities.java
@@ -23,17 +23,17 @@ import java.util.Calendar;
import java.util.List;
import org.sonar.api.platform.Server;
import org.sonar.api.platform.ServerStartHandler;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
+import org.sonar.ce.log.CeLogging;
+import org.sonar.ce.log.LogFileRef;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.ce.CeActivityDto;
-import org.sonar.ce.log.CeLogging;
-import org.sonar.ce.log.LogFileRef;
-@ServerSide
+@ComputeEngineSide
public class PurgeCeActivities implements ServerStartHandler {
private static final Logger LOGGER = Loggers.get(PurgeCeActivities.class);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelPluginRepository.java b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelPluginRepository.java
index fdaffcfed8d..cbf3c534126 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelPluginRepository.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelPluginRepository.java
@@ -29,7 +29,7 @@ import java.util.Collections;
import java.util.Map;
import org.picocontainer.Startable;
import org.sonar.api.Plugin;
-import org.sonar.api.SonarPlugin;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.core.platform.PluginInfo;
import org.sonar.core.platform.PluginRepository;
@@ -45,6 +45,7 @@ import static com.google.common.collect.Lists.newArrayList;
*
*/
@ServerSide
+@ComputeEngineSide
public class DebtModelPluginRepository implements Startable {
public static final String DEFAULT_MODEL = "technical-debt";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtRulesXMLImporter.java b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtRulesXMLImporter.java
index a2a379d9ac5..ae25444cb8d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtRulesXMLImporter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtRulesXMLImporter.java
@@ -37,6 +37,7 @@ import org.codehaus.staxmate.SMInputFactory;
import org.codehaus.staxmate.in.SMHierarchicCursor;
import org.codehaus.staxmate.in.SMInputCursor;
import org.sonar.api.rule.RuleKey;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.Duration;
import org.sonar.api.utils.ValidationMessages;
@@ -68,6 +69,7 @@ import static org.sonar.server.debt.DebtModelXMLExporter.RULE_KEY;
* Import rules debt definitions from an XML
*/
@ServerSide
+@ComputeEngineSide
public class DebtRulesXMLImporter {
public List importXML(String xml, ValidationMessages validationMessages) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/BaseIndex.java b/server/sonar-server/src/main/java/org/sonar/server/es/BaseIndex.java
index 1f7d44e3716..0172245b362 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/es/BaseIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/es/BaseIndex.java
@@ -19,9 +19,11 @@
*/
package org.sonar.server.es;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
@ServerSide
+@ComputeEngineSide
public abstract class BaseIndex {
public static final String SORT_SUFFIX = "sort";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelogService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelogService.java
index b8af151cba4..622508b1136 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelogService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelogService.java
@@ -22,6 +22,7 @@ package org.sonar.server.issue;
import java.util.Collection;
import java.util.List;
import org.sonar.api.issue.Issue;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.user.User;
import org.sonar.api.user.UserFinder;
@@ -34,6 +35,7 @@ import static com.google.common.collect.Lists.newArrayList;
* @since 3.6
*/
@ServerSide
+@ComputeEngineSide
public class IssueChangelogService {
private final IssueChangeDao changeDao;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java
index 737606925ee..8ce9913f876 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryService.java
@@ -41,6 +41,7 @@ import org.joda.time.DateTime;
import org.joda.time.format.ISOPeriodFormat;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.rule.RuleKey;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.SonarException;
@@ -74,6 +75,7 @@ import static org.sonarqube.ws.client.issue.IssueFilterParameters.SINCE_LEAK_PER
* This component is used to create an IssueQuery, in order to transform the component and component roots keys into uuid.
*/
@ServerSide
+@ComputeEngineSide
public class IssueQueryService {
public static final String LOGIN_MYSELF = "__me__";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
index 447f7fd50bc..190af4ebc68 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java
@@ -36,6 +36,7 @@ import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
import org.sonar.api.rules.RuleType;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.user.User;
import org.sonar.api.user.UserFinder;
@@ -61,6 +62,7 @@ import org.sonar.server.user.index.UserDoc;
import org.sonar.server.user.index.UserIndex;
@ServerSide
+@ComputeEngineSide
public class IssueService {
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java
index 3be9fef044e..5ad564e61b0 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java
@@ -33,6 +33,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.sonar.api.rules.RuleType;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.server.rule.RuleTagFormat;
import org.sonar.api.user.User;
@@ -48,6 +49,7 @@ import static com.google.common.base.Strings.isNullOrEmpty;
* Updates issue fields and chooses if changes must be kept in history.
*/
@ServerSide
+@ComputeEngineSide
public class IssueUpdater {
public static final String UNUSED = "";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationFactory.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationFactory.java
index 2979f0a1eac..75d6e009a7f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationFactory.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/NewIssuesNotificationFactory.java
@@ -19,12 +19,14 @@
*/
package org.sonar.server.issue.notification;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.Durations;
import org.sonar.db.DbClient;
import org.sonar.server.user.index.UserIndex;
@ServerSide
+@ComputeEngineSide
public class NewIssuesNotificationFactory {
private final UserIndex userIndex;
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/FunctionExecutor.java b/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/FunctionExecutor.java
index 392bb204fd7..129c55b2864 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/FunctionExecutor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/FunctionExecutor.java
@@ -21,6 +21,7 @@ package org.sonar.server.issue.workflow;
import javax.annotation.Nullable;
import org.sonar.api.issue.Issue;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.user.User;
import org.sonar.core.issue.DefaultIssue;
@@ -28,6 +29,7 @@ import org.sonar.core.issue.IssueChangeContext;
import org.sonar.server.issue.IssueUpdater;
@ServerSide
+@ComputeEngineSide
public class FunctionExecutor {
private final IssueUpdater updater;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java b/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java
index c14e8685114..e5a76c9fcfd 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java
@@ -25,6 +25,7 @@ import org.sonar.api.issue.DefaultTransitions;
import org.sonar.api.issue.Issue;
import org.sonar.api.issue.condition.HasResolution;
import org.sonar.api.issue.condition.NotCondition;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.web.UserRole;
import org.sonar.core.issue.DefaultIssue;
@@ -32,6 +33,7 @@ import org.sonar.core.issue.IssueChangeContext;
import org.sonar.server.issue.IssueUpdater;
@ServerSide
+@ComputeEngineSide
public class IssueWorkflow implements Startable {
public static final String AUTOMATIC_CLOSE_TRANSITION = "automaticclose";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcher.java
index eaf2bc277a4..944654e68e6 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcher.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcher.java
@@ -23,6 +23,7 @@ import org.apache.commons.lang.StringUtils;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -39,6 +40,7 @@ import org.sonar.api.server.ServerSide;
*
*/
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public abstract class NotificationDispatcher {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java b/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java
index 9538f2cf600..2031822f072 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationDispatcherMetadata.java
@@ -21,6 +21,7 @@ package org.sonar.server.notification;
import com.google.common.collect.Maps;
import java.util.Map;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -31,6 +32,7 @@ import org.sonar.api.server.ServerSide;
* Instances of these classes must be declared by {@link org.sonar.api.Plugin}.
*/
@ServerSide
+@ComputeEngineSide
public final class NotificationDispatcherMetadata {
public static final String GLOBAL_NOTIFICATION = "globalNotification";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationService.java b/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationService.java
index e44f313b79f..6e5aa86b926 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/notification/NotificationService.java
@@ -40,6 +40,7 @@ import org.sonar.api.Property;
import org.sonar.api.config.Settings;
import org.sonar.api.notifications.Notification;
import org.sonar.api.notifications.NotificationChannel;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
@@ -60,6 +61,7 @@ import org.sonar.db.DbClient;
global = false)
})
@ServerSide
+@ComputeEngineSide
public class NotificationService implements Startable {
private static final String THREAD_NAME_PREFIX = "sq-notification-service-";
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java
index 26e6def05e4..2c15b75735f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerLogging.java
@@ -27,6 +27,7 @@ import java.io.File;
import java.util.Set;
import org.slf4j.LoggerFactory;
import org.sonar.api.config.Settings;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.log.LoggerLevel;
import org.sonar.api.utils.log.Loggers;
@@ -34,6 +35,7 @@ import org.sonar.process.LogbackHelper;
import org.sonar.process.ProcessProperties;
@ServerSide
+@ComputeEngineSide
public class ServerLogging {
public static final Set ALLOWED_ROOT_LOG_LEVELS = Sets.immutableEnumSet(LoggerLevel.TRACE, LoggerLevel.DEBUG, LoggerLevel.INFO);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/Monitor.java b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/Monitor.java
index c87db9ad8f4..d4d6808865a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/Monitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/monitoring/Monitor.java
@@ -21,6 +21,7 @@ package org.sonar.server.platform.monitoring;
import com.google.common.base.Optional;
import java.util.Map;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.server.platform.ws.InfoAction;
@@ -28,6 +29,7 @@ import org.sonar.server.platform.ws.InfoAction;
* Any component that is involved in the information returned by the web service api/system/info
*/
@ServerSide
+@ComputeEngineSide
public interface Monitor {
/**
* Name of section in System Info page
diff --git a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarExploder.java b/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarExploder.java
index db74246c80f..8f6afbea373 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarExploder.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/plugins/ServerPluginJarExploder.java
@@ -21,6 +21,7 @@ package org.sonar.server.plugins;
import java.io.File;
import org.apache.commons.io.FileUtils;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.ZipUtils;
import org.sonar.core.platform.ExplodedPlugin;
@@ -31,6 +32,7 @@ import org.sonar.server.platform.DefaultServerFileSystem;
import static org.apache.commons.io.FileUtils.forceMkdir;
@ServerSide
+@ComputeEngineSide
public class ServerPluginJarExploder extends PluginJarExploder {
private final DefaultServerFileSystem fs;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettingsFactory.java b/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettingsFactory.java
index 68ec96a1b87..ce358473f0c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettingsFactory.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettingsFactory.java
@@ -21,11 +21,13 @@ package org.sonar.server.properties;
import java.util.List;
import org.sonar.api.config.Settings;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.property.PropertiesDao;
import org.sonar.db.property.PropertyDto;
@ServerSide
+@ComputeEngineSide
public class ProjectSettingsFactory {
private final PropertiesDao dao;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInProfiles.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInProfiles.java
index e74a78de1a1..f8b265aab8f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInProfiles.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/BuiltInProfiles.java
@@ -21,9 +21,9 @@ package org.sonar.server.qualityprofile;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
-import org.sonar.api.server.ServerSide;
-
import java.util.Collection;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* Used to list default profile names.
@@ -32,6 +32,7 @@ import java.util.Collection;
* just to get the profile names is too slow (see {@link org.sonar.api.profiles.ProfileDefinition}).
*/
@ServerSide
+@ComputeEngineSide
public class BuiltInProfiles {
// built-in profile names grouped by language
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileComparison.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileComparison.java
index afe1620aa94..c54ceed5b55 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileComparison.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileComparison.java
@@ -31,6 +31,7 @@ import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import org.sonar.api.rule.RuleKey;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
@@ -39,6 +40,7 @@ import org.sonar.db.qualityprofile.ActiveRuleParamDto;
import org.sonar.db.qualityprofile.QualityProfileDto;
@ServerSide
+@ComputeEngineSide
public class QProfileComparison {
private final DbClient dbClient;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLookup.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLookup.java
index 13ed6c46c65..52a389ebfd7 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLookup.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLookup.java
@@ -24,6 +24,7 @@ import com.google.common.collect.Iterables;
import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
@@ -32,6 +33,7 @@ import org.sonar.db.qualityprofile.QualityProfileDto;
import static com.google.common.collect.Lists.newArrayList;
@ServerSide
+@ComputeEngineSide
public class QProfileLookup {
private final DbClient db;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectLookup.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectLookup.java
index e14b0ebe826..c043a4c7a4d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectLookup.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectLookup.java
@@ -19,25 +19,24 @@
*/
package org.sonar.server.qualityprofile;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-
import javax.annotation.CheckForNull;
-
-import org.sonar.api.server.ServerSide;
import org.sonar.api.component.Component;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
import org.sonar.api.web.UserRole;
+import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.MyBatis;
import org.sonar.db.qualityprofile.QualityProfileDto;
-import org.sonar.db.DbClient;
import org.sonar.server.user.UserSession;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
@ServerSide
+@ComputeEngineSide
public class QProfileProjectLookup {
private final DbClient db;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectOperations.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectOperations.java
index 3645542fcee..5d82d81f65b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectOperations.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileProjectOperations.java
@@ -19,6 +19,7 @@
*/
package org.sonar.server.qualityprofile;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.web.UserRole;
import org.sonar.core.permission.GlobalPermissions;
@@ -35,6 +36,7 @@ import org.sonar.server.user.UserSession;
* Permission checks should also be done in the upper service.
*/
@ServerSide
+@ComputeEngineSide
public class QProfileProjectOperations {
private final DbClient db;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoader.java b/server/sonar-server/src/main/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoader.java
index 6def1c1b28a..519a64c80bb 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoader.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/DeprecatedRulesDefinitionLoader.java
@@ -33,6 +33,7 @@ import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rules.RuleParam;
import org.sonar.api.rules.RuleRepository;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.server.debt.DebtRemediationFunction;
import org.sonar.api.server.rule.RuleParamType;
@@ -52,6 +53,7 @@ import static com.google.common.collect.Lists.newArrayList;
* Inject deprecated RuleRepository into {@link org.sonar.api.server.rule.RulesDefinition} for backward-compatibility.
*/
@ServerSide
+@ComputeEngineSide
public class DeprecatedRulesDefinitionLoader {
private static final Logger LOG = Loggers.get(DeprecatedRulesDefinitionLoader.class);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/RuleRepositories.java b/server/sonar-server/src/main/java/org/sonar/server/rule/RuleRepositories.java
index 52bf1ec6461..df8060db628 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/RuleRepositories.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/RuleRepositories.java
@@ -23,15 +23,14 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.SetMultimap;
-import org.apache.commons.lang.builder.CompareToBuilder;
-import org.sonar.api.server.ServerSide;
-import org.sonar.api.server.rule.RulesDefinition;
-
-import javax.annotation.CheckForNull;
-
import java.util.Collection;
import java.util.Map;
import java.util.SortedSet;
+import javax.annotation.CheckForNull;
+import org.apache.commons.lang.builder.CompareToBuilder;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
+import org.sonar.api.server.rule.RulesDefinition;
/**
* This component keeps metadata of rule repositories.
@@ -42,6 +41,7 @@ import java.util.SortedSet;
* @since 4.2
*/
@ServerSide
+@ComputeEngineSide
public class RuleRepositories {
public static class Repository implements Comparable {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/index/UserIndex.java b/server/sonar-server/src/main/java/org/sonar/server/user/index/UserIndex.java
index 8045a49f462..ab5d886f254 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/user/index/UserIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/user/index/UserIndex.java
@@ -20,6 +20,12 @@
package org.sonar.server.user.index;
import com.google.common.base.Function;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.action.get.GetRequestBuilder;
import org.elasticsearch.action.get.GetResponse;
@@ -35,6 +41,7 @@ import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.core.util.NonNullInputFunction;
import org.sonar.server.es.EsClient;
@@ -43,17 +50,10 @@ import org.sonar.server.es.SearchOptions;
import org.sonar.server.es.SearchResult;
import org.sonar.server.exceptions.NotFoundException;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
import static java.lang.String.format;
@ServerSide
+@ComputeEngineSide
public class UserIndex {
/**
diff --git a/server/sonar-server/src/main/java/org/sonar/server/view/index/ViewIndex.java b/server/sonar-server/src/main/java/org/sonar/server/view/index/ViewIndex.java
index cdb862a2ae5..50bcb813a54 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/view/index/ViewIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/view/index/ViewIndex.java
@@ -19,6 +19,8 @@
*/
package org.sonar.server.view.index;
+import java.util.Collection;
+import java.util.List;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
@@ -26,15 +28,14 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.FilterBuilders;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.server.es.EsClient;
-import java.util.Collection;
-import java.util.List;
-
import static com.google.common.collect.Lists.newArrayList;
@ServerSide
+@ComputeEngineSide
public class ViewIndex {
private static final int SCROLL_TIME_IN_MINUTES = 3;
diff --git a/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java b/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java
index bc2eba47813..7539c40512a 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/DefaultResourceTypes.java
@@ -23,10 +23,12 @@ import org.sonar.api.batch.BatchSide;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.ResourceType;
import org.sonar.api.resources.ResourceTypeTree;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
@BatchSide
@ServerSide
+@ComputeEngineSide
public final class DefaultResourceTypes {
private static final String SUPPORTS_MEASURE_FILTERS = "supportsMeasureFilters";
diff --git a/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java b/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java
index 8ea60b6d2d0..72486d51c07 100644
--- a/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java
+++ b/sonar-core/src/main/java/org/sonar/core/i18n/DefaultI18n.java
@@ -43,6 +43,7 @@ import org.apache.commons.io.IOUtils;
import org.picocontainer.Startable;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.i18n.I18n;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.SonarException;
import org.sonar.api.utils.System2;
@@ -53,6 +54,7 @@ import org.sonar.core.platform.PluginRepository;
@BatchSide
@ServerSide
+@ComputeEngineSide
public class DefaultI18n implements I18n, Startable {
private static final Logger LOG = Loggers.get(DefaultI18n.class);
diff --git a/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java b/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java
index 69a59a21705..a3270e12e3f 100644
--- a/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java
+++ b/sonar-core/src/main/java/org/sonar/core/i18n/RuleI18nManager.java
@@ -25,6 +25,7 @@ import org.apache.commons.lang.StringUtils;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.i18n.RuleI18n;
import org.sonar.api.rules.Rule;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -33,6 +34,7 @@ import org.sonar.api.server.ServerSide;
@Deprecated
@BatchSide
@ServerSide
+@ComputeEngineSide
public class RuleI18nManager implements RuleI18n {
private static final String NAME_SUFFIX = ".name";
diff --git a/sonar-core/src/main/java/org/sonar/core/metric/BatchMetrics.java b/sonar-core/src/main/java/org/sonar/core/metric/BatchMetrics.java
index 3f626f79151..fbe8fb11b2e 100644
--- a/sonar-core/src/main/java/org/sonar/core/metric/BatchMetrics.java
+++ b/sonar-core/src/main/java/org/sonar/core/metric/BatchMetrics.java
@@ -28,7 +28,7 @@ import javax.annotation.Nullable;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.measures.Metric;
import org.sonar.api.measures.Metrics;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
import static com.google.common.collect.FluentIterable.from;
import static java.util.Arrays.asList;
@@ -86,7 +86,7 @@ import static org.sonar.api.measures.CoreMetrics.UNCOVERED_LINES;
*
* The batch should not send other metrics, and the Compute Engine should not allow other metrics.
*/
-@ServerSide
+@ComputeEngineSide
@BatchSide
public class BatchMetrics {
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
index 597311caf07..44be61d9266 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/ComponentContainer.java
@@ -38,6 +38,7 @@ import org.picocontainer.lifecycle.ReflectionLifecycleStrategy;
import org.picocontainer.monitors.NullComponentMonitor;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.config.PropertyDefinitions;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.log.Loggers;
import org.sonar.api.utils.log.Profiler;
@@ -47,6 +48,7 @@ import static java.util.Objects.requireNonNull;
@BatchSide
@ServerSide
+@ComputeEngineSide
public class ComponentContainer implements ContainerPopulator.Container {
private static final class ExtendedDefaultPicoContainer extends DefaultPicoContainer {
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
index 2853e39f0db..03a3c21f501 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
@@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.TempFolder;
import org.sonar.classloader.ClassloaderBuilder;
@@ -47,6 +48,7 @@ import static org.sonar.classloader.ClassloaderBuilder.LoadingOrder.SELF_FIRST;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class PluginClassloaderFactory {
// underscores are used to not conflict with plugin keys (if someday a plugin key is "api")
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java
index 9f302ac81f7..f90c2881f43 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginRepository.java
@@ -22,6 +22,7 @@ package org.sonar.core.platform;
import java.util.Collection;
import org.sonar.api.Plugin;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -29,6 +30,7 @@ import org.sonar.api.server.ServerSide;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public interface PluginRepository {
Collection getPluginInfos();
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
index 8b8b32a1534..b4e0dd844e5 100644
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueChangeDao.java
@@ -25,6 +25,7 @@ import java.util.Collection;
import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.core.issue.DefaultIssueComment;
import org.sonar.core.issue.FieldDiffs;
@@ -36,6 +37,7 @@ import org.sonar.db.MyBatis;
import static java.util.Arrays.asList;
@ServerSide
+@ComputeEngineSide
public class IssueChangeDao implements Dao {
private final MyBatis mybatis;
diff --git a/sonar-db/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java b/sonar-db/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java
index f83a3460228..0d883a62bd8 100644
--- a/sonar-db/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/measure/custom/CustomMeasureDao.java
@@ -24,6 +24,7 @@ import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import org.apache.ibatis.session.RowBounds;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.Dao;
import org.sonar.db.DatabaseUtils;
@@ -31,6 +32,7 @@ import org.sonar.db.DbSession;
import org.sonar.db.RowNotFoundException;
@ServerSide
+@ComputeEngineSide
public class CustomMeasureDao implements Dao {
public void insert(DbSession session, CustomMeasureDto customMeasureDto) {
mapper(session).insert(customMeasureDto);
diff --git a/sonar-db/src/main/java/org/sonar/db/permission/PermissionRepository.java b/sonar-db/src/main/java/org/sonar/db/permission/PermissionRepository.java
index 9befe3689cd..cd62f93ec3f 100644
--- a/sonar-db/src/main/java/org/sonar/db/permission/PermissionRepository.java
+++ b/sonar-db/src/main/java/org/sonar/db/permission/PermissionRepository.java
@@ -27,6 +27,7 @@ import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.config.Settings;
import org.sonar.api.security.DefaultGroups;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
@@ -43,6 +44,7 @@ import org.sonar.db.user.UserRoleDto;
* WARNING, this class is called by Deveveloper Cockpit to apply default permission template on new developers
*/
@ServerSide
+@ComputeEngineSide
public class PermissionRepository {
private final DbClient dbClient;
diff --git a/sonar-db/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java b/sonar-db/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java
index 8d41e91fbe4..f761eafda52 100644
--- a/sonar-db/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java
+++ b/sonar-db/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java
@@ -22,6 +22,7 @@ package org.sonar.db.purge.period;
import com.google.common.annotations.VisibleForTesting;
import java.util.List;
import org.sonar.api.config.Settings;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.log.Logger;
@@ -33,6 +34,7 @@ import org.sonar.db.purge.PurgeSnapshotQuery;
import org.sonar.db.purge.PurgeableSnapshotDto;
@ServerSide
+@ComputeEngineSide
public class DefaultPeriodCleaner {
private static final Logger LOG = Loggers.get(DefaultPeriodCleaner.class);
diff --git a/sonar-db/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java b/sonar-db/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
index 089adea159e..1f11add1fee 100644
--- a/sonar-db/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
@@ -27,6 +27,7 @@ import java.util.List;
import java.util.Map;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.System2;
import org.sonar.db.Dao;
@@ -36,6 +37,7 @@ import org.sonar.db.RowNotFoundException;
import org.sonar.db.component.ComponentDto;
@ServerSide
+@ComputeEngineSide
public class QualityProfileDao implements Dao {
private final MyBatis mybatis;
diff --git a/sonar-db/src/main/java/org/sonar/db/user/AuthorizationDao.java b/sonar-db/src/main/java/org/sonar/db/user/AuthorizationDao.java
index 18f34820c04..d24381d4e49 100644
--- a/sonar-db/src/main/java/org/sonar/db/user/AuthorizationDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/user/AuthorizationDao.java
@@ -27,6 +27,7 @@ import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import org.apache.ibatis.session.SqlSession;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.db.Dao;
import org.sonar.db.DatabaseUtils;
@@ -36,6 +37,7 @@ import org.sonar.db.MyBatis;
import static com.google.common.collect.Maps.newHashMap;
@ServerSide
+@ComputeEngineSide
public class AuthorizationDao implements Dao {
private static final String USER_ID_PARAM = "userId";
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java b/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java
index ac67fe1c2bf..bf097a28939 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/Plugin.java
@@ -88,9 +88,11 @@ public interface Plugin {
/**
* Add an extension as :
*
- * - a Class that is annotated with {@link org.sonar.api.batch.BatchSide} or {@link org.sonar.api.server.ServerSide}.
+ *
- a Class that is annotated with {@link org.sonar.api.batch.BatchSide}, {@link org.sonar.api.server.ServerSide}
+ * or {@link org.sonar.api.server.ComputeEngineSide}.
* The extension will be instantiated once. Its dependencies are injected through constructor parameters.
- * - an instance that is annotated with {@link org.sonar.api.batch.BatchSide} or {@link org.sonar.api.server.ServerSide}
+ * - an instance that is annotated with {@link org.sonar.api.batch.BatchSide}, {@link org.sonar.api.server.ServerSide}
+ * or {@link org.sonar.api.server.ComputeEngineSide}.
*
* Only a single component can be registered for a class. It's not allowed for example to register:
*
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ServerComponent.java b/sonar-plugin-api/src/main/java/org/sonar/api/ServerComponent.java
index f09f8f30cfb..1ef9445d95e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/ServerComponent.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/ServerComponent.java
@@ -25,7 +25,7 @@ import org.sonar.api.server.ServerSide;
* Same than {@link org.sonar.api.BatchComponent} but for server-side components.
*
* @since 2.2
- * @deprecated since 5.2 use {@link ServerSide} annotation
+ * @deprecated in 5.2. Use {@link ServerSide} annotation instead.
*/
@Deprecated
@ServerSide
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ServerExtension.java b/sonar-plugin-api/src/main/java/org/sonar/api/ServerExtension.java
index c643ad2212c..15450df6a89 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/ServerExtension.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/ServerExtension.java
@@ -19,13 +19,14 @@
*/
package org.sonar.api;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
* Server extension point.
*
* @since 1.10
- * @deprecated since 5.2 replaced by {@link ServerSide} and {@link ExtensionPoint} annotations
+ * @deprecated since 5.2. Use annotations {@link ServerSide} or {@link ComputeEngineSide} and {@link ExtensionPoint}
*/
@Deprecated
public interface ServerExtension extends Extension, ServerComponent {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java b/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java
index 5d76568ad17..0889546d04e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/SonarQubeVersion.java
@@ -21,6 +21,7 @@ package org.sonar.api;
import javax.annotation.concurrent.Immutable;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.Version;
@@ -104,6 +105,7 @@ import static java.util.Objects.requireNonNull;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
@Immutable
public class SonarQubeVersion {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java
index bf0789bed58..620bef139bc 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/MeasureComputer.java
@@ -24,7 +24,7 @@ import java.util.Set;
import javax.annotation.CheckForNull;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.ce.measure.MeasureComputer.MeasureComputerDefinition.Builder;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.ce.ComputeEngineSide;
/**
* Define how to compute new measures on some metrics declared by {@link org.sonar.api.measures.Metrics}.
@@ -88,7 +88,7 @@ import org.sonar.api.server.ServerSide;
*
* @since 5.2
*/
-@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public interface MeasureComputer {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
index 8472a00a7ac..59aa02e28e5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
@@ -20,8 +20,9 @@
package org.sonar.api.config;
import com.google.common.base.Objects;
-import org.sonar.api.batch.BatchSide;
import org.sonar.api.CoreProperties;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -31,6 +32,7 @@ import org.sonar.api.server.ServerSide;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class EmailSettings {
public static final String SMTP_HOST = "email.smtp_host.secured";
public static final String SMTP_HOST_DEFAULT = "";
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java
index 1dedc143a76..7c753e31252 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinition.java
@@ -23,20 +23,19 @@ import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
-import org.sonar.api.batch.BatchSide;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.Property;
import org.sonar.api.PropertyType;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.batch.BatchSide;
import org.sonar.api.resources.Qualifiers;
-
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* Declare a plugin property. Values are available at runtime through the component {@link Settings}.
@@ -70,6 +69,7 @@ import java.util.List;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public final class PropertyDefinition {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
index 6a815bd019c..c2e427b1e17 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
@@ -20,22 +20,21 @@
package org.sonar.api.config;
import com.google.common.base.Strings;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.batch.BatchSide;
import org.sonar.api.CoreProperties;
import org.sonar.api.Properties;
import org.sonar.api.Property;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.AnnotationUtils;
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* Metadata of all the properties declared by plugins
*
@@ -43,6 +42,7 @@ import java.util.Map;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public final class PropertyDefinitions {
private final Map definitions = new HashMap<>();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
index fc5100ce2c4..6f10d573020 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
@@ -24,21 +24,20 @@ import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.DateUtils;
-import javax.annotation.Nullable;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
/**
* Project settings on batch side, or global settings on server side. This component does not access to database, so
* property changed via setter methods are not persisted.
@@ -88,6 +87,7 @@ import java.util.Properties;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class Settings {
protected Map properties;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
index 5d4779d2bbc..f44233a6a9f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
@@ -19,13 +19,12 @@
*/
package org.sonar.api.i18n;
-import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
-
-import javax.annotation.Nullable;
-
import java.util.Date;
import java.util.Locale;
+import javax.annotation.Nullable;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* Main component that provides translation facilities.
@@ -34,6 +33,7 @@ import java.util.Locale;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public interface I18n {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
index c799b5eb598..3f70eeeef67 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/RuleI18n.java
@@ -19,13 +19,12 @@
*/
package org.sonar.api.i18n;
+import java.util.Locale;
+import javax.annotation.CheckForNull;
import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
import org.sonar.api.rules.Rule;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Locale;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* {@link I18n}-companion component that provides translation facilities for rule names, descriptions and parameter names.
@@ -36,6 +35,7 @@ import java.util.Locale;
@Deprecated
@BatchSide
@ServerSide
+@ComputeEngineSide
public interface RuleI18n {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
index 89d82faa8a0..8b5bfcda75d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
@@ -31,6 +31,7 @@ import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.batch.InstantiationStrategy;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import static com.google.common.base.Objects.firstNonNull;
@@ -40,6 +41,7 @@ import static org.apache.commons.lang.StringUtils.isNotBlank;
@BatchSide
@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ServerSide
+@ComputeEngineSide
public class Metric implements Serializable, org.sonar.api.batch.measure.Metric {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
index fbd6ec03530..5aceb4f2471 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
@@ -19,13 +19,12 @@
*/
package org.sonar.api.measures;
-import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
-
-import javax.annotation.CheckForNull;
-
import java.util.Collection;
import java.util.List;
+import javax.annotation.CheckForNull;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* @since 2.5
@@ -34,6 +33,7 @@ import java.util.List;
@Deprecated
@BatchSide
@ServerSide
+@ComputeEngineSide
public interface MetricFinder {
@CheckForNull
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java
index 61ee341158f..96521bac3a5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metrics.java
@@ -19,12 +19,12 @@
*/
package org.sonar.api.measures;
-import org.sonar.api.batch.BatchSide;
+import java.util.List;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.batch.BatchSide;
import org.sonar.api.batch.InstantiationStrategy;
-
-import java.util.List;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* @since 1.10
@@ -32,6 +32,7 @@ import java.util.List;
@BatchSide
@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public interface Metrics {
List getMetrics();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationChannel.java b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationChannel.java
index dbee36f675a..d80f325f476 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationChannel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationChannel.java
@@ -20,6 +20,7 @@
package org.sonar.api.notifications;
import org.sonar.api.ExtensionPoint;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -36,6 +37,7 @@ import org.sonar.api.server.ServerSide;
* @since 2.10
*/
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public abstract class NotificationChannel {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
index c68cbd2370b..0968b5f3d03 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java
@@ -23,6 +23,7 @@ import java.io.File;
import java.util.Date;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -30,6 +31,7 @@ import org.sonar.api.server.ServerSide;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public abstract class Server {
public abstract String getId();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerFileSystem.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerFileSystem.java
index 04b6b927319..d54049aae0e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerFileSystem.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerFileSystem.java
@@ -19,15 +19,16 @@
*/
package org.sonar.api.platform;
-import org.sonar.api.server.ServerSide;
-
import java.io.File;
import java.util.List;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* @since 2.3
*/
@ServerSide
+@ComputeEngineSide
public interface ServerFileSystem {
File getHomeDir();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStartHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStartHandler.java
index e76a2e521d6..43f8058a2f8 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStartHandler.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStartHandler.java
@@ -20,12 +20,14 @@
package org.sonar.api.platform;
import org.sonar.api.ExtensionPoint;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
* @since 2.2
*/
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public interface ServerStartHandler {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStopHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStopHandler.java
index 782edbe60e6..01ed6b16862 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStopHandler.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerStopHandler.java
@@ -20,12 +20,14 @@
package org.sonar.api.platform;
import org.sonar.api.ExtensionPoint;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
* @since 2.2
*/
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public interface ServerStopHandler {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerUpgradeStatus.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerUpgradeStatus.java
index 22e3dbf171e..7751060a6c7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerUpgradeStatus.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/ServerUpgradeStatus.java
@@ -19,12 +19,14 @@
*/
package org.sonar.api.platform;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
* @since 2.5
*/
@ServerSide
+@ComputeEngineSide
public interface ServerUpgradeStatus {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java
index 5f01495ba28..cddc1e512d8 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/AnnotationProfileParser.java
@@ -19,21 +19,22 @@
*/
package org.sonar.api.profiles;
+import java.util.Collection;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.server.ServerSide;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RuleAnnotationUtils;
import org.sonar.api.rules.RuleFinder;
import org.sonar.api.rules.RulePriority;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.ValidationMessages;
import org.sonar.check.BelongsToProfile;
-import java.util.Collection;
-
/**
* @since 2.3
*/
@ServerSide
+@ComputeEngineSide
public final class AnnotationProfileParser {
private final RuleFinder ruleFinder;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java
index 19089949845..e1f65d3b68b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java
@@ -19,14 +19,13 @@
*/
package org.sonar.api.profiles;
+import java.io.Reader;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.ValidationMessages;
-import java.io.Reader;
-
/**
* @since 2.3
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileParser.java
index 0bfdc614cce..6e77b0e3168 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileParser.java
@@ -35,6 +35,7 @@ import org.sonar.api.rules.ActiveRule;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RuleFinder;
import org.sonar.api.rules.RulePriority;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.ValidationMessages;
@@ -42,6 +43,7 @@ import org.sonar.api.utils.ValidationMessages;
* @since 2.3
*/
@ServerSide
+@ComputeEngineSide
public class XMLProfileParser {
private final RuleFinder ruleFinder;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileSerializer.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileSerializer.java
index 84888f73b16..d1b070abf15 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileSerializer.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/XMLProfileSerializer.java
@@ -19,20 +19,21 @@
*/
package org.sonar.api.profiles;
+import java.io.IOException;
+import java.io.Writer;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.server.ServerSide;
import org.sonar.api.rules.ActiveRule;
import org.sonar.api.rules.ActiveRuleParam;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.SonarException;
-import java.io.IOException;
-import java.io.Writer;
-
/**
* @since 2.3
*/
@ServerSide
+@ComputeEngineSide
public class XMLProfileSerializer {
public void write(RulesProfile profile, Writer writer) {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
index 625169adf01..cd0e1b2ee2a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
@@ -19,10 +19,11 @@
*/
package org.sonar.api.resources;
-import org.sonar.api.batch.BatchSide;
import org.sonar.api.ExtensionPoint;
-import org.sonar.api.server.ServerSide;
+import org.sonar.api.batch.BatchSide;
import org.sonar.api.batch.InstantiationStrategy;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* The extension point to define a new language
@@ -34,6 +35,7 @@ import org.sonar.api.batch.InstantiationStrategy;
@BatchSide
@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public interface Language {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
index 232f7b1c942..ffb93f6f744 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
@@ -20,17 +20,17 @@
package org.sonar.api.resources;
import com.google.common.collect.Maps;
-import org.apache.commons.lang.ArrayUtils;
-import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
-import org.sonar.api.utils.log.Logger;
-import org.sonar.api.utils.log.Loggers;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang.ArrayUtils;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
/**
* A class to store the list of languages
@@ -39,6 +39,7 @@ import java.util.Map;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class Languages {
private static final Logger LOG = Loggers.get(Languages.class);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java
index 50f8181ddca..8f7c2e37a65 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypeTree.java
@@ -26,19 +26,20 @@ import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ListMultimap;
-import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* @since 2.14
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class ResourceTypeTree {
private final List types;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypes.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypes.java
index 02beeab6ede..c8e3cccd3fc 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypes.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceTypes.java
@@ -37,6 +37,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -44,6 +45,7 @@ import org.sonar.api.server.ServerSide;
*/
@Beta
@ServerSide
+@ComputeEngineSide
public class ResourceTypes {
public static final Predicate AVAILABLE_FOR_FILTERS = new Predicate() {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java
index 187f835d569..36b32882af7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java
@@ -24,8 +24,12 @@ import com.google.common.base.Function;
import com.google.common.base.Functions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.PropertyType;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.AnnotationUtils;
import org.sonar.api.utils.FieldUtils2;
@@ -33,16 +37,13 @@ import org.sonar.api.utils.SonarException;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
-import java.lang.reflect.Field;
-import java.util.Collection;
-import java.util.List;
-
/**
* @since 2.3
* @deprecated in 4.2. Replaced by {@link org.sonar.api.server.rule.RulesDefinitionAnnotationLoader}
*/
@Deprecated
@ServerSide
+@ComputeEngineSide
public final class AnnotationRuleParser {
private static final Logger LOG = Loggers.get(AnnotationRuleParser.class);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleFinder.java
index 882f7868105..e662def172d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleFinder.java
@@ -19,14 +19,13 @@
*/
package org.sonar.api.rules;
+import java.util.Collection;
+import javax.annotation.CheckForNull;
import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.rule.RuleKey;
-
-import javax.annotation.CheckForNull;
-
-import java.util.Collection;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* @since 2.3
@@ -35,6 +34,7 @@ import java.util.Collection;
@Deprecated
@BatchSide
@ServerSide
+@ComputeEngineSide
public interface RuleFinder {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleRepository.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleRepository.java
index 3d477768942..6d1f9c407b1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleRepository.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/RuleRepository.java
@@ -19,20 +19,21 @@
*/
package org.sonar.api.rules;
+import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.ExtensionPoint;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
-import java.util.List;
-
/**
* @since 2.3
* @deprecated in 4.2. Replaced by org.sonar.api.server.rule.RulesDefinition
*/
@Deprecated
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public abstract class RuleRepository {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java
index ebae9b504a6..6a47931441d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java
@@ -24,6 +24,16 @@ import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Closeables;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.CharEncoding;
import org.apache.commons.lang.StringUtils;
@@ -31,28 +41,18 @@ import org.codehaus.staxmate.SMInputFactory;
import org.codehaus.staxmate.in.SMHierarchicCursor;
import org.codehaus.staxmate.in.SMInputCursor;
import org.sonar.api.PropertyType;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.SonarException;
import org.sonar.check.Cardinality;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
/**
* @since 2.3
* @deprecated in 4.2. Replaced by org.sonar.api.server.rule.RulesDefinition and org.sonar.api.server.rule.RulesDefinitionXmlLoader
*/
@Deprecated
@ServerSide
+@ComputeEngineSide
public final class XMLRuleParser {
private static final Map TYPE_MAP = typeMapWithDeprecatedValues();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserFinder.java
index 929b0792e4a..32dc64795c7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserFinder.java
@@ -20,6 +20,7 @@
package org.sonar.api.security;
import org.sonar.api.database.model.User;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -28,6 +29,7 @@ import org.sonar.api.server.ServerSide;
*/
@Deprecated
@ServerSide
+@ComputeEngineSide
public interface UserFinder {
User findById(int id);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java
index 5de81929e64..d51b211d920 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ServerSide.java
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
import org.sonar.api.batch.BatchSide;
/**
- * Same than {@link BatchSide} but for server-side components.
+ * Same as {@link BatchSide} but for server-side components.
*
* @since 5.2
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtModel.java
index 4a30cf91d4c..392916a17fa 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/DebtModel.java
@@ -19,16 +19,17 @@
*/
package org.sonar.api.server.debt;
+import java.util.List;
import javax.annotation.CheckForNull;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
-import java.util.List;
-
/**
* @since 4.3
* @deprecated in 5.2. It will be dropped in version 6.0 (see https://jira.sonarsource.com/browse/SONAR-6393)
*/
@ServerSide
+@ComputeEngineSide
@Deprecated
public interface DebtModel {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
index 94d5ef5c065..f986ff7248e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
@@ -43,6 +43,7 @@ import org.sonar.api.ExtensionPoint;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
import org.sonar.api.rules.RuleType;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.server.debt.DebtRemediationFunction;
import org.sonar.api.utils.log.Loggers;
@@ -147,6 +148,7 @@ import static org.apache.commons.lang.StringUtils.trimToNull;
* @since 4.3
*/
@ServerSide
+@ComputeEngineSide
@ExtensionPoint
public interface RulesDefinition {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionI18nLoader.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionI18nLoader.java
index 790683805af..1a915f168bf 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionI18nLoader.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionI18nLoader.java
@@ -20,8 +20,9 @@
package org.sonar.api.server.rule;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.server.ServerSide;
import org.sonar.api.i18n.RuleI18n;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* Loads the English bundles of rules (name, description and parameters) that are
@@ -36,6 +37,7 @@ import org.sonar.api.i18n.RuleI18n;
* @since 4.3
*/
@ServerSide
+@ComputeEngineSide
public class RulesDefinitionI18nLoader {
private final RuleI18n i18n;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java
index 6ee19d515bd..71020e0b28d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java
@@ -35,6 +35,7 @@ import org.codehaus.staxmate.in.SMInputCursor;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
import org.sonar.api.rules.RuleType;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
import org.sonar.api.server.debt.DebtRemediationFunction;
import org.sonar.check.Cardinality;
@@ -178,6 +179,7 @@ import static org.apache.commons.lang.StringUtils.trim;
* @since 4.3
*/
@ServerSide
+@ComputeEngineSide
public class RulesDefinitionXmlLoader {
private enum DescriptionFormat {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/user/UserFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/user/UserFinder.java
index eca30472e98..f81ad8a3529 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/user/UserFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/user/UserFinder.java
@@ -21,6 +21,7 @@ package org.sonar.api.user;
import java.util.List;
import javax.annotation.CheckForNull;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -29,6 +30,7 @@ import org.sonar.api.server.ServerSide;
*/
@Deprecated
@ServerSide
+@ComputeEngineSide
public interface UserFinder {
@CheckForNull
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
index 69e6780e5e8..5645f5223b7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Durations.java
@@ -25,6 +25,7 @@ import org.sonar.api.CoreProperties;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.config.Settings;
import org.sonar.api.i18n.I18n;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -34,6 +35,7 @@ import org.sonar.api.server.ServerSide;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class Durations {
public enum DurationFormat {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
index 8dd268f4c7c..1b82eb6dac0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java
@@ -27,6 +27,7 @@ import java.util.TimeZone;
import javax.annotation.CheckForNull;
import org.apache.commons.lang.SystemUtils;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
/**
@@ -64,6 +65,7 @@ import org.sonar.api.server.ServerSide;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class System2 {
public static final System2 INSTANCE = new System2();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java
index 07476bad436..a1cd561677f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/TempFolder.java
@@ -19,13 +19,12 @@
*/
package org.sonar.api.utils;
+import java.io.File;
+import javax.annotation.Nullable;
import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.server.ServerSide;
-import javax.annotation.Nullable;
-
-import java.io.File;
-
/**
* Use this component to deal with temp files/folders. Root location of temp files/folders
* depends on situation:
@@ -38,6 +37,7 @@ import java.io.File;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public interface TempFolder {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java
index 20b54203335..562f313509c 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/UriReader.java
@@ -25,9 +25,6 @@ import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.io.Files;
-import org.sonar.api.batch.BatchSide;
-import org.sonar.api.server.ServerSide;
-
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -35,6 +32,9 @@ import java.nio.charset.Charset;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import org.sonar.api.batch.BatchSide;
+import org.sonar.api.ce.ComputeEngineSide;
+import org.sonar.api.server.ServerSide;
/**
* Reads different types of URI. Supported schemes are http and file.
@@ -43,6 +43,7 @@ import java.util.Map;
*/
@BatchSide
@ServerSide
+@ComputeEngineSide
public class UriReader {
private final Map processorsByScheme = Maps.newHashMap();
--
2.39.5