aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java/org
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-03-31 16:27:21 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-03-31 16:55:01 +0200
commita81d697437999945c1acbd8117bf01b94906941b (patch)
tree889f02747ae111af7d01133a54343aadda422099 /sonar-plugin-api/src/main/java/org
parent0dd3ac65fe67516316d153a4ce950a74fd1aa0e0 (diff)
downloadsonarqube-a81d697437999945c1acbd8117bf01b94906941b.tar.gz
sonarqube-a81d697437999945c1acbd8117bf01b94906941b.zip
SONAR-6717 Drop issue.Action API
Diffstat (limited to 'sonar-plugin-api/src/main/java/org')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java102
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java46
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Function.java46
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/action/package-info.java23
4 files changed, 0 insertions, 217 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java
deleted file mode 100644
index 9112f6cd637..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Action.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.issue.action;
-
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import java.util.List;
-import org.sonar.api.issue.Issue;
-import org.sonar.api.issue.condition.Condition;
-
-import static com.google.common.collect.Lists.newArrayList;
-
-/**
- * @since 3.6
- * @deprecated in 5.5. Webapp cannot be customized anymore to define actions on issues
- */
-@Deprecated
-public class Action {
-
- private final String key;
- private final List<Condition> conditions;
- private final List<Function> functions;
-
- Action(String key) {
- Preconditions.checkArgument(!Strings.isNullOrEmpty(key), "Action key must be set");
- this.key = key;
- this.conditions = newArrayList();
- this.functions = newArrayList();
- }
-
- public String key() {
- return key;
- }
-
- public Action setConditions(Condition... conditions) {
- this.conditions.addAll(ImmutableList.copyOf(conditions));
- return this;
- }
-
- public List<Condition> conditions() {
- return conditions;
- }
-
- public Action setFunctions(Function... functions) {
- this.functions.addAll(ImmutableList.copyOf(functions));
- return this;
- }
-
- public List<Function> functions() {
- return functions;
- }
-
- public boolean supports(Issue issue) {
- for (Condition condition : conditions) {
- if (!condition.matches(issue)) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Action that = (Action) o;
- return key.equals(that.key);
- }
-
- @Override
- public int hashCode() {
- return key.hashCode();
- }
-
- @Override
- public String toString() {
- return key;
- }
-
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java
deleted file mode 100644
index 29dd04cd835..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Actions.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.issue.action;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.sonar.api.server.ServerSide;
-
-/**
- * @since 3.6
- * @deprecated in 5.5. Webapp cannot be customized anymore to define actions on issues
- */
-@Deprecated
-@ServerSide
-public class Actions {
-
- private final List<Action> list = new ArrayList<>();
-
- public Action add(String actionKey) {
- Action action = new Action(actionKey);
- this.list.add(action);
- return action;
- }
-
- public List<Action> list() {
- return list;
- }
-
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Function.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Function.java
deleted file mode 100644
index d0e1a99ba7b..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/Function.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.issue.action;
-
-import com.google.common.annotations.Beta;
-import org.sonar.api.config.Settings;
-import org.sonar.api.issue.Issue;
-
-import javax.annotation.Nullable;
-
-/**
- * @since 3.6
- */
-@Beta
-public interface Function {
-
- void execute(Context context);
-
- interface Context {
- Issue issue();
-
- Settings projectSettings();
-
- Context setAttribute(String key, @Nullable String value);
-
- Context addComment(@Nullable String text);
- }
-
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/package-info.java
deleted file mode 100644
index 700451e8741..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/action/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program 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.
- *
- * This program 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.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.api.issue.action;
-
-import javax.annotation.ParametersAreNonnullByDefault;