com.atlassian.greenhopper.service.statistics
Class MarkerServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.statistics.MarkerServiceImpl
All Implemented Interfaces:
MarkerService

@Service(value="gh-markerService")
public class MarkerServiceImpl
extends java.lang.Object
implements MarkerService

Service for doing things to Markers. The persistence concept is ultra-lazy/fallback, meaning that Markers are fine living without any record in the underlying propertyset. The objects handle that internally. TODO this must be changed since it's intransparent.

Author:
ahennecke

Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.statistics.MarkerService
SERVICE
 
Constructor Summary
MarkerServiceImpl()
           
 
Method Summary
 void clearCache()
          Clears out any internal caches.
 java.util.Map<java.lang.String,java.util.Set<Marker>> getCompiledMarkers(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, IssueField sortField, java.lang.String key, com.atlassian.query.Query query)
          "compile" here means find the position of the marker in the issue list and link it to that issue, depending on the marker's configuration.
 Marker getMarker(XProject xproject, ViewDefinition view, java.lang.String key, WatchedField watchedField)
           
 boolean isMarkerEnabled(XProject xproject, ViewDefinition view, WatchedField watchedField)
          Check if the marker is enabled, without having to load the whole marker.
 Marker setMarkerToIssue(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, java.lang.String key, WatchedField watchedField, com.atlassian.jira.issue.Issue forcedPosition, com.atlassian.query.Query query, ErrorCollection errorCollection)
          In order to position the marker at a particular issue, it gets informed about its "forced position" and then pushed into the collector.
 Marker setMarkerToValue(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, java.lang.String key, WatchedField watchedField, java.lang.String forcedValue, com.atlassian.query.Query query, ErrorCollection errorCollection)
          Set the marker to a particular value
 void toggleMarker(XProject xproject, ViewDefinition view, WatchedField watchedField)
          Switch the marker on/off
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkerServiceImpl

public MarkerServiceImpl()
Method Detail

getMarker

public Marker getMarker(XProject xproject,
                        ViewDefinition view,
                        java.lang.String key,
                        WatchedField watchedField)
Specified by:
getMarker in interface MarkerService
key - : The key is part of the propertySet key that is used to identify the record. This could be as simple as a boardId, but also include a secondary filter (like the version on the assignee board).
Returns:
the marker for the given parameters. If there's no data present, the marker will fall back to defaults. It is never null.

isMarkerEnabled

public boolean isMarkerEnabled(XProject xproject,
                               ViewDefinition view,
                               WatchedField watchedField)
Description copied from interface: MarkerService
Check if the marker is enabled, without having to load the whole marker.

Specified by:
isMarkerEnabled in interface MarkerService

toggleMarker

public void toggleMarker(XProject xproject,
                         ViewDefinition view,
                         WatchedField watchedField)
Description copied from interface: MarkerService
Switch the marker on/off

Specified by:
toggleMarker in interface MarkerService

getCompiledMarkers

public java.util.Map<java.lang.String,java.util.Set<Marker>> getCompiledMarkers(com.opensymphony.user.User user,
                                                                                XProject xproject,
                                                                                ViewDefinition view,
                                                                                IssueField sortField,
                                                                                java.lang.String key,
                                                                                com.atlassian.query.Query query)
"compile" here means find the position of the marker in the issue list and link it to that issue, depending on the marker's configuration.

Specified by:
getCompiledMarkers in interface MarkerService
Returns:
the markers that are positioned at the given issues (map key = issueKey)

setMarkerToIssue

public Marker setMarkerToIssue(com.opensymphony.user.User user,
                               XProject xproject,
                               ViewDefinition view,
                               java.lang.String key,
                               WatchedField watchedField,
                               com.atlassian.jira.issue.Issue forcedPosition,
                               com.atlassian.query.Query query,
                               ErrorCollection errorCollection)
In order to position the marker at a particular issue, it gets informed about its "forced position" and then pushed into the collector. This will calculate the max value the marker needs to have in order to be positioned there. It's all a bit through-the-loop-inside-out.

Specified by:
setMarkerToIssue in interface MarkerService

setMarkerToValue

public Marker setMarkerToValue(com.opensymphony.user.User user,
                               XProject xproject,
                               ViewDefinition view,
                               java.lang.String key,
                               WatchedField watchedField,
                               java.lang.String forcedValue,
                               com.atlassian.query.Query query,
                               ErrorCollection errorCollection)
Description copied from interface: MarkerService
Set the marker to a particular value

Specified by:
setMarkerToValue in interface MarkerService

clearCache

public void clearCache()
Description copied from interface: MarkerService
Clears out any internal caches.

Specified by:
clearCache in interface MarkerService


Copyright © 2007-2011 Atlassian. All Rights Reserved.