001/*
002 * SonarQube
003 * Copyright (C) 2009-2017 SonarSource SA
004 * mailto:info AT sonarsource DOT com
005 *
006 * This program is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019 */
020package org.sonar.api.batch.postjob;
021
022import org.sonar.api.batch.AnalysisMode;
023import org.sonar.api.batch.postjob.issue.PostJobIssue;
024import org.sonar.api.config.Configuration;
025import org.sonar.api.config.Settings;
026
027/**
028 * See {@link PostJob#execute(PostJobContext)}
029 * @since 5.2
030 */
031public interface PostJobContext {
032
033  /**
034   * @deprecated since 6.5 use {@link PostJobContext#config()}
035   */
036  @Deprecated
037  Settings settings();
038
039  /**
040   * Get configuration of the current project.
041   * @since 6.5
042   */
043  Configuration config();
044
045  AnalysisMode analysisMode();
046
047  // ----------- Only available in preview mode --------------
048
049  /**
050   * All the unresolved issues of the project, including the issues reported by end-users. Only available in preview/issues mode.
051   * @throw {@link UnsupportedOperationException} if not in preview/issues mode. To test the mode you can use {@link #analysisMode()}.
052   */
053  Iterable<PostJobIssue> issues();
054
055  /**
056   * All the issues of this project that have been marked as resolved during this scan. Only available in preview/issues mode.
057   * @throw {@link UnsupportedOperationException} if not in preview mode. To test the mode you can use {@link #analysisMode()}.
058   */
059  Iterable<PostJobIssue> resolvedIssues();
060
061}