com.atlassian.jira.project.statistics.type
Class AbstractOpenByNodeAssocStatisticType

java.lang.Object
  extended bycom.atlassian.jira.project.statistics.type.AbstractStatisticType
      extended bycom.atlassian.jira.project.statistics.type.AbstractOpenByStatisticType
          extended bycom.atlassian.jira.project.statistics.type.AbstractOpenByNodeAssocStatisticType
All Implemented Interfaces:
java.util.Comparator, StatisticType
Direct Known Subclasses:
TypeOpenByAffectedVersion, TypeOpenByComponent, TypeOpenByFixVersion

public abstract class AbstractOpenByNodeAssocStatisticType
extends AbstractOpenByStatisticType

This is an abstract class that contains some common functionality for Node Associated StatisticTypes. Each StatisticType that is Node Associated should extend this class


Field Summary
 
Fields inherited from class com.atlassian.jira.project.statistics.type.AbstractOpenByStatisticType
CHANGED_RESOLUTION, GOTTEN_RESOLVED, GOTTEN_UNRESOLVED, STAYED_RESOLVED, STAYED_UNRESOLVED
 
Fields inherited from interface com.atlassian.jira.project.statistics.StatisticType
OPEN_BY_AFFECTED_VERSION, OPEN_BY_ASSIGNEE, OPEN_BY_COMPONENT, OPEN_BY_FIX_VERSION, OPEN_BY_PRIORITY, STATUS
 
Constructor Summary
AbstractOpenByNodeAssocStatisticType()
           
 
Method Summary
protected  void amendCollectionForCreateUnresolved(StatisticCollection statisticsCollection, StatisticsUpdateEvent event)
          Amend the StatisticCollection for a create StatisticsUpdateEvent.
protected  void amendCollectionForDeleteUnresolved(StatisticCollection statisticsCollection, StatisticsUpdateEvent event)
          Amend the StatisticCollection for a delete StatisticsUpdateEvent.
protected  void amendCollectionForUpdateGottenResolved(StatisticCollection statisticsCollection, StatisticsUpdateEvent event)
           
protected  void amendCollectionForUpdateGottenUnresolved(StatisticCollection statisticsCollection, StatisticsUpdateEvent event)
           
protected  void amendCollectionForUpdateStayedUnresolved(StatisticCollection statisticsCollection, StatisticsUpdateEvent event)
           
protected  void calculateAssigneeStatisticsCollection(StatisticCollection statisticCollection, ProjectStatistics projectStats, GenericValue securityLevel)
           
protected  void calculateReporterStatisticsCollection(StatisticCollection statisticCollection, ProjectStatistics projectStats, GenericValue securityLevel)
           
 int compare(java.lang.Object o1, java.lang.Object o2)
          Alphatetic Comparator to sort 2 objects alphabetically
protected abstract  boolean doIssueConditionsMeet(GenericValue issue)
          Checks that any conditions that are placed on the issue for this Statistic Type are met.
 boolean equals(java.lang.Object o)
           
protected abstract  java.util.Collection getAssociatedEntities(GenericValue project)
          Gets a list of the entities associated with the project.
protected abstract  java.lang.String getAssociationName()
          This is the name of the association between the issue and the entity.
protected  java.util.Collection getEntities(ProjectStatistics projectStatistics)
           
protected  java.util.Collection getIssueEntities(GenericValue issue)
          Get a list of the issues entities
protected  java.util.Collection getIssues(ProjectStatistics projectStats, GenericValue securityLevel, java.lang.Object entity)
           
protected  java.lang.String getKey(GenericValue issue, java.lang.Object entity)
           
protected abstract  SearchParameter getNullEntityParameter()
          Return a search parameter which will filter out any issues with this entity associated.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.jira.project.statistics.type.AbstractOpenByStatisticType
amendCollection, getResolutionTransitionState
 
Methods inherited from class com.atlassian.jira.project.statistics.type.AbstractStatisticType
calculateStatisticsCollection, decrementStatisticInCollection, decrementStatisticInCollectionWithSecurityType, getFieldName, incrementStatisticInCollection, incrementStatisticInCollectionWithSecurityType, isResolved
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractOpenByNodeAssocStatisticType

public AbstractOpenByNodeAssocStatisticType()
Method Detail

getAssociationName

protected abstract java.lang.String getAssociationName()
This is the name of the association between the issue and the entity.


getAssociatedEntities

protected abstract java.util.Collection getAssociatedEntities(GenericValue project)
                                                       throws GenericEntityException
Gets a list of the entities associated with the project.

Throws:
GenericEntityException

doIssueConditionsMeet

protected abstract boolean doIssueConditionsMeet(GenericValue issue)
Checks that any conditions that are placed on the issue for this Statistic Type are met. This should be overridden by sub type. This is used for null entities


getIssueEntities

protected java.util.Collection getIssueEntities(GenericValue issue)
Get a list of the issues entities


getKey

protected java.lang.String getKey(GenericValue issue,
                                  java.lang.Object entity)
Specified by:
getKey in class AbstractStatisticType

getEntities

protected java.util.Collection getEntities(ProjectStatistics projectStatistics)
                                    throws GenericEntityException
Specified by:
getEntities in class AbstractStatisticType
Throws:
GenericEntityException

getIssues

protected java.util.Collection getIssues(ProjectStatistics projectStats,
                                         GenericValue securityLevel,
                                         java.lang.Object entity)
                                  throws GenericEntityException
Specified by:
getIssues in class AbstractStatisticType
Throws:
GenericEntityException

calculateAssigneeStatisticsCollection

protected void calculateAssigneeStatisticsCollection(StatisticCollection statisticCollection,
                                                     ProjectStatistics projectStats,
                                                     GenericValue securityLevel)

calculateReporterStatisticsCollection

protected void calculateReporterStatisticsCollection(StatisticCollection statisticCollection,
                                                     ProjectStatistics projectStats,
                                                     GenericValue securityLevel)

getNullEntityParameter

protected abstract SearchParameter getNullEntityParameter()
Return a search parameter which will filter out any issues with this entity associated. For example with components, this parameter should return issues with no attached components.


amendCollectionForCreateUnresolved

protected void amendCollectionForCreateUnresolved(StatisticCollection statisticsCollection,
                                                  StatisticsUpdateEvent event)
                                           throws StatisticOutOfDateException
Amend the StatisticCollection for a create StatisticsUpdateEvent.

This will normally happen when an issue is created. The corresponding entities of the issue are iterated over. The Statistic object for that entity is then incremented. If the Statistic did not exist it is created with a value of 1.

Specified by:
amendCollectionForCreateUnresolved in class AbstractOpenByStatisticType
Throws:
StatisticOutOfDateException

amendCollectionForDeleteUnresolved

protected void amendCollectionForDeleteUnresolved(StatisticCollection statisticsCollection,
                                                  StatisticsUpdateEvent event)
                                           throws StatisticOutOfDateException
Amend the StatisticCollection for a delete StatisticsUpdateEvent.

This will normally happen when an issue is deleted. The corresponding entities of the issue are iterated over. The Statistic object for that entity is then decremented. If the value of the Statistic after this decrement is 0 then it is deleted form the StatisticCollection

Specified by:
amendCollectionForDeleteUnresolved in class AbstractOpenByStatisticType
Throws:
StatisticOutOfDateException

amendCollectionForUpdateGottenResolved

protected void amendCollectionForUpdateGottenResolved(StatisticCollection statisticsCollection,
                                                      StatisticsUpdateEvent event)
                                               throws StatisticOutOfDateException
Specified by:
amendCollectionForUpdateGottenResolved in class AbstractOpenByStatisticType
Throws:
StatisticOutOfDateException

amendCollectionForUpdateGottenUnresolved

protected void amendCollectionForUpdateGottenUnresolved(StatisticCollection statisticsCollection,
                                                        StatisticsUpdateEvent event)
                                                 throws StatisticOutOfDateException
Specified by:
amendCollectionForUpdateGottenUnresolved in class AbstractOpenByStatisticType
Throws:
StatisticOutOfDateException

amendCollectionForUpdateStayedUnresolved

protected void amendCollectionForUpdateStayedUnresolved(StatisticCollection statisticsCollection,
                                                        StatisticsUpdateEvent event)
                                                 throws StatisticOutOfDateException
Specified by:
amendCollectionForUpdateStayedUnresolved in class AbstractOpenByStatisticType
Throws:
StatisticOutOfDateException

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Alphatetic Comparator to sort 2 objects alphabetically


equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()