org.sonar.plugins.core.sensors
Class CloseReviewsDecorator

java.lang.Object
  extended by org.sonar.plugins.core.sensors.CloseReviewsDecorator
All Implemented Interfaces:
CheckProject, Decorator, BatchComponent, BatchExtension, Extension

public class CloseReviewsDecorator
extends Object
implements Decorator

Decorator that handles the life cycle of a review (for instance, closes a review when its corresponding violation has been fixed).


Field Summary
static String REVIEW_LIFECYCLE_BARRIER
           
 
Constructor Summary
CloseReviewsDecorator(Project project, ResourcePersister resourcePersister, DatabaseSession databaseSession, NotificationManager notificationManager, UserFinder userFinder)
           
 
Method Summary
protected  int closeReviewsForDeletedResources(int projectId, int projectSnapshotId)
          Close reviews that relate to resources that have been deleted or renamed.
protected  int closeReviewsOnResolvedViolations(Resource resource, int resourceId, int snapshotId)
          Close reviews for which violations have been fixed.
 void decorate(Resource resource, DecoratorContext context)
           
protected  int reopenReviewsOnUnresolvedViolations(Resource resource, int resourceId)
          Reopen reviews that had been set to resolved but for which the violation is still here.
 boolean shouldExecuteOnProject(Project project)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVIEW_LIFECYCLE_BARRIER

public static final String REVIEW_LIFECYCLE_BARRIER
See Also:
Constant Field Values
Constructor Detail

CloseReviewsDecorator

public CloseReviewsDecorator(Project project,
                             ResourcePersister resourcePersister,
                             DatabaseSession databaseSession,
                             NotificationManager notificationManager,
                             UserFinder userFinder)
Method Detail

shouldExecuteOnProject

public boolean shouldExecuteOnProject(Project project)
Specified by:
shouldExecuteOnProject in interface CheckProject

decorate

public void decorate(Resource resource,
                     DecoratorContext context)
Specified by:
decorate in interface Decorator

closeReviewsOnResolvedViolations

protected int closeReviewsOnResolvedViolations(Resource resource,
                                               int resourceId,
                                               int snapshotId)
Close reviews for which violations have been fixed.


reopenReviewsOnUnresolvedViolations

protected int reopenReviewsOnUnresolvedViolations(Resource resource,
                                                  int resourceId)
Reopen reviews that had been set to resolved but for which the violation is still here. Manual violations are ignored.


closeReviewsForDeletedResources

protected int closeReviewsForDeletedResources(int projectId,
                                              int projectSnapshotId)
Close reviews that relate to resources that have been deleted or renamed.



Copyright © 2009-2012 SonarSource. All Rights Reserved.