aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java/org/sonar/api
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-09-04 09:26:36 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-09-04 10:58:30 +0200
commitd3fad486224567cbef53cb97c40f857990220a67 (patch)
tree1f0d6abee58729061482c1c5dcfb9ba6bd00a740 /sonar-plugin-api/src/main/java/org/sonar/api
parent7e588cc35e5ba2a68281ca00184a220865150150 (diff)
downloadsonarqube-d3fad486224567cbef53cb97c40f857990220a67.tar.gz
sonarqube-d3fad486224567cbef53cb97c40f857990220a67.zip
SONAR-4602 Revert eviction of dryRun cache on settings change
as it is not needed
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar/api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/GlobalPropertyChangeHandler.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/SettingsChangeHandler.java85
2 files changed, 3 insertions, 92 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/GlobalPropertyChangeHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/GlobalPropertyChangeHandler.java
index 07e8def006d..45f549e1086 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/GlobalPropertyChangeHandler.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/GlobalPropertyChangeHandler.java
@@ -19,6 +19,8 @@
*/
package org.sonar.api.config;
+import org.sonar.api.ServerExtension;
+
import javax.annotation.Nullable;
/**
@@ -31,7 +33,7 @@ import javax.annotation.Nullable;
*
* @since 3.0
*/
-public abstract class GlobalPropertyChangeHandler implements SettingsChangeHandler {
+public abstract class GlobalPropertyChangeHandler implements ServerExtension {
public static final class PropertyChange {
private String key;
@@ -65,10 +67,4 @@ public abstract class GlobalPropertyChangeHandler implements SettingsChangeHandl
*/
public abstract void onChange(PropertyChange change);
- @Override
- public void onChange(SettingsChange change) {
- if (change.isGlobal()) {
- onChange(PropertyChange.create(change.key(), change.newValue()));
- }
- }
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/SettingsChangeHandler.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/SettingsChangeHandler.java
deleted file mode 100644
index 09b800049a2..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/SettingsChangeHandler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 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.api.config;
-
-import org.sonar.api.ServerExtension;
-
-import javax.annotation.Nullable;
-
-/**
- * Observe changes of properties done from web application. It does not support :
- * <ul>
- * <li>changes done programmatically on the component org.sonar.api.config.Settings</li>
- * <li>changes done when restoring settings from XML using backup/restore feature</li>
- * </ul>
- *
- * @since 4.0
- */
-public interface SettingsChangeHandler extends ServerExtension {
-
- public static final class SettingsChange {
- private String key;
- private String newValue;
- private String componentKey;
- private String userLogin;
-
- private SettingsChange(String key, @Nullable String newValue, @Nullable String componentKey, @Nullable String userLogin) {
- this.key = key;
- this.newValue = newValue;
- this.componentKey = componentKey;
- this.userLogin = userLogin;
- }
-
- public static SettingsChange create(String key, @Nullable String newValue, @Nullable String componentKey, @Nullable String userLogin) {
- return new SettingsChange(key, newValue, componentKey, userLogin);
- }
-
- public String key() {
- return key;
- }
-
- public String newValue() {
- return newValue;
- }
-
- public String componentKey() {
- return componentKey;
- }
-
- public String userLogin() {
- return userLogin;
- }
-
- public boolean isGlobal() {
- return componentKey == null && userLogin == null;
- }
-
- @Override
- public String toString() {
- return String.format("[key=%s, newValue=%s, componentKey=%s]", key, newValue, componentKey);
- }
- }
-
- /**
- * This method gets called when a property is changed.
- */
- public void onChange(SettingsChange change);
-
-}