From 0847774db59344316629a7171c3943dbfaa3f52d Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Fri, 18 Sep 2015 11:43:24 +0200 Subject: SONAR-6777 Project cache sync --- .../org/sonar/api/batch/bootstrap/ProjectKey.java | 24 ++++++++++++++++++++++ .../sonar/api/batch/bootstrap/ProjectReactor.java | 10 ++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java (limited to 'sonar-plugin-api/src') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.java new file mode 100644 index 00000000000..8238f33837f --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectKey.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.api.batch.bootstrap; + +public interface ProjectKey { + String get(); +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java index 81e2dbe3267..ddb09d932ff 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectReactor.java @@ -29,7 +29,7 @@ import java.util.List; * @since 2.9 */ @BatchSide -public class ProjectReactor { +public class ProjectReactor implements ProjectKey { private ProjectDefinition root; @@ -67,4 +67,12 @@ public class ProjectReactor { } return null; } + + @Override + public String get() { + if (root != null) { + return root.getKeyWithBranch(); + } + return null; + } } -- cgit v1.2.3