001/*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube 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 * SonarQube 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;
021
022/**
023 * Barriers are used to define the order of execution of Decorators. Decorators must be annotated with the following :
024 * <p/>
025 * <ul>
026 * <li>{@code @DependsUpon(BARRIER)} in order to be executed after BARRIER</li>
027 * <li>{@code @DependedUpon(BARRIER)} in order to be executed before BARRIER</li>
028 * </ul>
029 *
030 * @since 2.3
031 */
032public interface DecoratorBarriers {
033
034  /**
035   * This barrier is before {@link #ISSUES_TRACKED}. The decorators that register issues must be declared before this
036   * barrier : {@code @DependedUpon(value=DecoratorBarriers.ISSUES_ADDED)}
037   *
038   * @since 3.6
039   */
040  String ISSUES_ADDED = "END_OF_VIOLATIONS_GENERATION";
041
042  /**
043   * This barrier is after {@link #ISSUES_ADDED}. The decorators that need to list all issues must be declared
044   * after this barrier : {@code @DependsUpon(value=DecoratorBarriers.ISSUES_TRACKED)}
045   *
046   * @since 3.6
047   */
048  String ISSUES_TRACKED = "END_OF_VIOLATION_TRACKING";
049
050
051  /**
052   * @deprecated in 3.6. Not required anymore.
053   */
054  @Deprecated
055  String START_VIOLATIONS_GENERATION = "START_VIOLATIONS_GENERATION";
056
057  /**
058   * This barrier is used by a decorator in order to :
059   * <ul>
060   * <li>be executed after all the decorators which generate violations :
061   * {@code @DependsUpon(value=DecoratorBarriers.END_OF_VIOLATIONS_GENERATION}</li>
062   * <li>declare that it generates violations : {@code @DependedUpon(value=DecoratorBarriers.END_OF_VIOLATIONS_GENERATION}</li>
063   * </ul>
064   *
065   * @deprecated in 3.6. Replaced by {@link #ISSUES_ADDED}
066   */
067  @Deprecated
068  String END_OF_VIOLATIONS_GENERATION = "END_OF_VIOLATIONS_GENERATION";
069
070  /**
071   * Extensions which call the method {@code Violation#setSwitchedOff} must be executed before this barrier
072   * ({@code @DependedUpon(value=DecoratorBarriers.VIOLATION_TRACKING})
073   * <p/>
074   * This barrier is after {@code END_OF_VIOLATIONS_GENERATION}
075   *
076   * @since 2.8
077   * @deprecated in 3.6. Not required anymore.
078   */
079  @Deprecated
080  String START_VIOLATION_TRACKING = "START_VIOLATION_TRACKING";
081
082  /**
083   * This barrier is after {@code END_OF_VIOLATIONS_GENERATION} and {@code START_VIOLATION_TRACKING}.
084   * Decorators executed after this barrier ({@code @DependsUpon(value=DecoratorBarriers.END_OF_VIOLATION_TRACKING})
085   * can benefit from all the features of violation tracking :
086   * <ul>
087   * <li>{@code Violation#getCreatedAt()}</li>
088   * <li>{@code Violation#isSwitchedOff()}, usually to know if a violation has been flagged as false-positives in UI</li>
089   * </ul>
090   *
091   * @since 2.8
092   * @deprecated in 3.6. Replaced by {@link #ISSUES_TRACKED}
093   */
094  @Deprecated
095  String END_OF_VIOLATION_TRACKING = "END_OF_VIOLATION_TRACKING";
096
097  /**
098   * @since 2.13
099   * @deprecated in 3.6. Issues are persisted at the end of analysis.
100   */
101  @Deprecated
102  String START_VIOLATION_PERSISTENCE = "START_VIOLATION_PERSISTENCE";
103
104  /**
105   * @since 2.13
106   * @deprecated in 3.6. Issues are persisted at the end of analysis
107   */
108  @Deprecated
109  String END_OF_VIOLATION_PERSISTENCE = "END_OF_VIOLATION_PERSISTENCE";
110
111  /**
112   * Any kinds of time machine data are calculated before this barrier. Decorators executed after this barrier can use
113   * Measure#getVariationValue() and Measure#getTendency() methods.
114   *
115   * @since 2.5
116   */
117  String END_OF_TIME_MACHINE = "END_OF_TIME_MACHINE";
118}