org.electrocodeogram.cpc.notification.api.strategy
Interface INotificationEvaluationStrategy


public interface INotificationEvaluationStrategy

Interface for strategies which support the NotificationEvaluationProvider in reaching its decision about how to handle a given clone content modification.

Implementations of this interface can be registered with the NotificationEvaluationProvider by extending the corresponding CPC Notification extension point "notificationEvaluationStategies".

All strategies are treated as singletons. An implementation should expect concurrent calls to all methods of this interface.

Author:
vw
See Also:
NotificationEvaluationProvider

Nested Class Summary
static class INotificationEvaluationStrategy.Status
          Return status indicator for evaluateModification(IClone, List, boolean, INotificationEvaluationStrategyResult).
 
Method Summary
 INotificationEvaluationStrategy.Status evaluateModification(IClone modifiedClone, java.util.List<IClone> groupMembers, boolean initialEvaluation, INotificationEvaluationStrategyResult result)
          Takes a modified clone and a list of its clone group members and evaluates whether what kind of action should be taken.
 

Method Detail

evaluateModification

INotificationEvaluationStrategy.Status evaluateModification(IClone modifiedClone,
                                                            java.util.List<IClone> groupMembers,
                                                            boolean initialEvaluation,
                                                            INotificationEvaluationStrategyResult result)
Takes a modified clone and a list of its clone group members and evaluates whether what kind of action should be taken.

Parameters:
modifiedClone - the clone which was modified, never null.
groupMembers - a list of all group members of the clone's clone group, the modified clone itself is also part of this list, size always >=2, never null. The IClone instance will contain a description of the latest modifications as CloneDiffs inside of an ICloneModificationHistoryExtension object. However, no CloneDiffs will be available during reevaluation of an event.
initialEvaluation - true if this is the first time this modification is evaluated. Typically this is set to true when the modification is first seen as an CloneModificationEvent and set to false for later reevaluations due to (delayed) CloneNotificationEvents.
result - an initially empty wrapper of IEvaluationResults. The strategy should add its own results as a new IEvaluationResult to this wrapper. A strategy may add multiple IEvaluationResults. Never null.
Returns:
the INotificationEvaluationStrategy.Status of this evaluation, never null.