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 currently only closes a review when its corresponding violation has been fixed.


Constructor Summary
CloseReviewsDecorator(Project project, ResourcePersister resourcePersister, DatabaseSession databaseSession, NotificationManager notificationManager, UserFinder userFinder)
           
 
Method Summary
protected  int closeReviews(Resource resource, int resourceId, int snapshotId)
          Close reviews for which violations have been fixed.
protected  int closeReviewsForDeletedResources(int projectId, int projectSnapshotId)
          Close reviews that relate to resources that have been deleted or renamed.
 void decorate(Resource resource, DecoratorContext context)
           
protected  int reopenReviews(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
 

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

closeReviews

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


reopenReviews

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


closeReviewsForDeletedResources

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



Copyright © 2009-2011 SonarSource. All Rights Reserved.