aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2014-10-27 15:21:41 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2014-10-27 15:37:44 +0100
commit0bd5aa471951185f4e5a8abdb3d496ec373bf9de (patch)
tree7c5ad4e301b89fb45a01f0a6a96208c616de2102 /sonar-core
parente8edd1d603b0aa54d2f43e046780f7d6981d5d0e (diff)
downloadsonarqube-0bd5aa471951185f4e5a8abdb3d496ec373bf9de.tar.gz
sonarqube-0bd5aa471951185f4e5a8abdb3d496ec373bf9de.zip
SONAR-5628 - Compute Engine - Remove sonar-dbcleaner-plugin
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTask.java3
-rw-r--r--sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/package-info.java (renamed from sonar-core/src/main/java/org/sonar/core/computation/package-info.java)2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/period/DefaultPeriodCleaner.java3
-rw-r--r--sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/DbCleanerConstants.java24
-rw-r--r--sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/PurgeTask.java47
5 files changed, 76 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTask.java b/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTask.java
index 4cd7799c297..9f74b4fe341 100644
--- a/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTask.java
+++ b/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTask.java
@@ -30,11 +30,12 @@ import org.sonar.core.computation.dbcleaner.period.DefaultPeriodCleaner;
import org.sonar.core.purge.PurgeConfiguration;
import org.sonar.core.purge.PurgeDao;
import org.sonar.core.purge.PurgeProfiler;
+import org.sonar.plugins.dbcleaner.api.PurgeTask;
/**
* @since 2.14
*/
-public class DefaultPurgeTask {
+public class DefaultPurgeTask implements PurgeTask {
private static final Logger LOG = LoggerFactory.getLogger(DefaultPurgeTask.class);
private PurgeDao purgeDao;
diff --git a/sonar-core/src/main/java/org/sonar/core/computation/package-info.java b/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/package-info.java
index 218db23b3fb..8a7156fd308 100644
--- a/sonar-core/src/main/java/org/sonar/core/computation/package-info.java
+++ b/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/package-info.java
@@ -19,6 +19,6 @@
*/
@ParametersAreNonnullByDefault
-package org.sonar.core.computation;
+package org.sonar.core.computation.dbcleaner;
import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/period/DefaultPeriodCleaner.java b/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/period/DefaultPeriodCleaner.java
index 76b1238dc07..a7f8a482533 100644
--- a/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/period/DefaultPeriodCleaner.java
+++ b/sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/period/DefaultPeriodCleaner.java
@@ -23,6 +23,7 @@ package org.sonar.core.computation.dbcleaner.period;
import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.sonar.api.ServerExtension;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Project;
import org.sonar.api.task.TaskExtension;
@@ -33,7 +34,7 @@ import org.sonar.core.purge.PurgeableSnapshotDto;
import java.util.List;
-public class DefaultPeriodCleaner implements TaskExtension {
+public class DefaultPeriodCleaner implements TaskExtension, ServerExtension {
private static final Logger LOG = LoggerFactory.getLogger(DefaultPeriodCleaner.class);
private PurgeDao purgeDao;
diff --git a/sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/DbCleanerConstants.java b/sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/DbCleanerConstants.java
new file mode 100644
index 00000000000..881fca768a3
--- /dev/null
+++ b/sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/DbCleanerConstants.java
@@ -0,0 +1,24 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.plugins.dbcleaner.api;
+
+@Deprecated
+public interface DbCleanerConstants extends org.sonar.core.computation.dbcleaner.DbCleanerConstants {
+}
diff --git a/sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/PurgeTask.java b/sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/PurgeTask.java
new file mode 100644
index 00000000000..070866a721c
--- /dev/null
+++ b/sonar-core/src/main/java/org/sonar/plugins/dbcleaner/api/PurgeTask.java
@@ -0,0 +1,47 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.plugins.dbcleaner.api;
+
+import org.sonar.api.ServerExtension;
+import org.sonar.api.task.TaskExtension;
+
+/**
+ * @since 2.14
+ */
+@Deprecated
+public interface PurgeTask extends TaskExtension, ServerExtension {
+ /**
+ * Purges the data related to a tree of resources.
+ * <p/>
+ * Exceptions are logged and are not thrown again, so this method fails only on {@link Error}s.
+ *
+ * @param resourceId the root of the tree
+ * @return this
+ */
+ PurgeTask purge(long resourceId);
+
+ /**
+ * Completely deletes a tree of resources.
+ *
+ * @param resourceId the root of the tree
+ * @return this
+ */
+ PurgeTask delete(long resourceId);
+}