|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.atlassian.jira.project.statistics.StatisticsManagerImpl
This class manages the Statistics of a project. From this class Statistics are loaded, retrieved, updated etc.
Field Summary |
Fields inherited from interface com.atlassian.jira.project.statistics.StatisticsManager |
CREATE_EVENT, DELETE_EVENT, MOVE_EVENT, UPDATE_EVENT |
Constructor Summary | |
StatisticsManagerImpl()
Construct a StatisticsManager with the default configuration file. |
|
StatisticsManagerImpl(java.lang.String configFile)
Construct a StatisticsManager with a given configuration file. |
Method Summary | |
java.util.Map |
getAllStatistics()
Returns a Map containing the Statistics for all projects that have had their statistics loaded. |
StatisticCollection |
getStatistics(org.ofbiz.core.entity.GenericValue securityLevel,
StatisticType statisticType,
org.ofbiz.core.entity.GenericValue project)
Get the StatisticCollection for this StatisticType , security level and project. |
StatisticCollection |
getStatistics(com.opensymphony.module.user.User user,
StatisticType statisticType,
org.ofbiz.core.entity.GenericValue project)
Returns a StatisticCollection object visible for a particular User based on StatisticType
and project. |
long |
getTotalStatistics(StatisticType statisticType,
java.lang.String key,
org.ofbiz.core.entity.GenericValue project)
Get the total statistical value for this StatisticType , key and project. |
java.util.Map |
getTypes()
Returns a Map containing all the StatisticType objects that have been loaded |
long |
getUsersTotalStatistics(com.opensymphony.module.user.User user,
StatisticType statisticType,
java.lang.String key,
org.ofbiz.core.entity.GenericValue project)
Get the total statistical value for this StatisticType , key and project for all issues that the user can see given their
issue security levels. |
void |
loadStatisticsForAllProjects()
Load all the statistics for every project into this StatisticsManagerImpl . |
ProjectStatistics |
refreshProjectStatistics(org.ofbiz.core.entity.GenericValue project)
Refresh the Statistics for a given project |
java.lang.String |
toString()
|
void |
updateStatistics(StatisticsUpdateEvent event)
Updates the Statistics based on an issue and its changegroup. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StatisticsManagerImpl()
public StatisticsManagerImpl(java.lang.String configFile)
Method Detail |
public void loadStatisticsForAllProjects()
StatisticsManagerImpl
.
If you want to pre-cache all statistics, call this method straight after constructing a StatisticsManager.
Alternatively if you want to lazy load statistics, don't call loadStatisticsForAllProjects() and the first time statistics for a particular project are accessed, they will be loaded.
loadStatisticsForAllProjects
in interface StatisticsManager
public StatisticCollection getStatistics(org.ofbiz.core.entity.GenericValue securityLevel, StatisticType statisticType, org.ofbiz.core.entity.GenericValue project)
StatisticCollection
for this StatisticType
, security level and project.
First the ProjectStatistics
will be retrieved for this project and from this the
StatisticCollection
for this security level and StatisticType will be returned
getStatistics
in interface StatisticsManager
public java.util.Map getTypes()
StatisticType
objects that have been loaded
getTypes
in interface StatisticsManager
public java.util.Map getAllStatistics()
If loadStatisticsForAllProjects() has been called then this map will contain the Statistics for all Projects.
getAllStatistics
in interface StatisticsManager
public StatisticCollection getStatistics(com.opensymphony.module.user.User user, StatisticType statisticType, org.ofbiz.core.entity.GenericValue project)
StatisticCollection
object visible for a particular User
based on StatisticType
and project.
It firstly gets the StatisticCollection
for no security level for this StatisticType
and project
It then gets all the Security Levels that the User
has access to. It loops through these levels and
gets the StatisticCollection
for this level, StatisticType
and project.
It merges each StatisticCollection
to get one single StatisticCollection
object and this is returned
getStatistics
in interface StatisticsManager
public java.lang.String toString()
toString
in class java.lang.Object
public ProjectStatistics refreshProjectStatistics(org.ofbiz.core.entity.GenericValue project)
The ProjectStatistics
object for the given project is removed
from the Project Statistics Map and then they are recalculated and added again
refreshProjectStatistics
in interface StatisticsManager
public void updateStatistics(StatisticsUpdateEvent event) throws org.ofbiz.core.entity.GenericEntityException
This method gets the ProjectStatistics
object based on the project of the issue passed in. UpdateStatistics is then
called on this object
updateStatistics
in interface StatisticsManager
org.ofbiz.core.entity.GenericEntityException
ProjectStatistics.updateStatistics(com.atlassian.jira.project.statistics.StatisticsUpdateEvent)
public long getTotalStatistics(StatisticType statisticType, java.lang.String key, org.ofbiz.core.entity.GenericValue project)
StatisticType
, key and project. For example the Statistics
for OpenByAssignee for "joe" in Project X
The ProjectStatistics
object for this project is retrieved. For each SecurityStatistic
in this ProjectStatistics, the StatisticCollection
object for this StatisticType is retrieved.
The value of the Statistic
object with this key is taken from the StatisticCollection and
added to the total.
getTotalStatistics
in interface StatisticsManager
public long getUsersTotalStatistics(com.opensymphony.module.user.User user, StatisticType statisticType, java.lang.String key, org.ofbiz.core.entity.GenericValue project) throws java.lang.Exception
StatisticType
, key and project for all issues that the user can see given their
issue security levels.
For example the Statistics for OpenByAssignee for "joe" in Project X that the user can see
The ProjectStatistics
object for this project is retrieved. For each SecurityStatistic
in this ProjectStatistics, if the security level is one that the user has access to then , the StatisticCollection
object for this StatisticType is retrieved.
The value of the Statistic
object with this key is taken from the StatisticCollection and
added to the total.
getUsersTotalStatistics
in interface StatisticsManager
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |