com.atlassian.greenhopper.service.statistics
Class CapacityService2Impl

java.lang.Object
  extended by com.atlassian.greenhopper.service.statistics.CapacityService2Impl
All Implemented Interfaces:
CapacityService2

@Service(value="gh-capacityService2")
public class CapacityService2Impl
extends java.lang.Object
implements CapacityService2

Capacity service provides capacity objects for a given xproject/board


Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.statistics.CapacityService2
SERVICE
 
Constructor Summary
CapacityService2Impl()
           
 
Method Summary
 Capacities getCapacities(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, java.lang.String key, ProjectConfiguration configuration)
          Get the capacities object for a collection of watched fields.
 Capacity getCapacity(com.atlassian.jira.project.Project project, ViewDefinition view, java.lang.String key, WatchedField watchedField)
          Deprecated. 
 Capacity getCapacity(XProject xproject, ViewDefinition view, java.lang.String key, WatchedField watchedField)
          Get the capacities object for a collection of watched fields.
 Capacities getDefaultCapacities(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, ProjectConfiguration configuration)
          Get the default capacities object for a collection of watched fields.
 Capacity getDefaultCapacity(XProject xproject, ViewDefinition view, WatchedField watchedField)
          Fetch a default Capacity object given a xproject
 ErrorCollection removeCapacity(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, java.lang.String key, WatchedField watchedField)
          Removes the capacity for the given parameters.
 ErrorCollection removeDefaultCapacity(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, WatchedField watchedField)
          Removes the default capacity for a given xproject and boardType
 ErrorCollection setCapacity(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, java.lang.String key, WatchedField watchedField, Capacity capacity)
          Set the capacity min/max values
 ErrorCollection setDefaultCapacity(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, WatchedField watchedField, Capacity capacity)
          Update the default capacity min/max values with the values currently set in the Capacity object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapacityService2Impl

public CapacityService2Impl()
Method Detail

getCapacity

public Capacity getCapacity(XProject xproject,
                            ViewDefinition view,
                            java.lang.String key,
                            WatchedField watchedField)
Get the capacities object for a collection of watched fields.

Specified by:
getCapacity in interface CapacityService2
Parameters:
xproject - the xproject a Capacity is stored against
key - The key to find capacities for. This is normally the actual board id, but could also be the column id (task board) and would be null for the default capacities.
watchedField - the watched field to get capacity for
Returns:
a Capacity object for the given parameters. Never returns null

getDefaultCapacity

public Capacity getDefaultCapacity(XProject xproject,
                                   ViewDefinition view,
                                   WatchedField watchedField)
Description copied from interface: CapacityService2
Fetch a default Capacity object given a xproject

Specified by:
getDefaultCapacity in interface CapacityService2
Parameters:
xproject - the xproject a Capacity is stored against
watchedField - the watched field to get capacity for
Returns:
a Capacity object for the given parameters. Never returns null

getCapacity

@Deprecated
public Capacity getCapacity(com.atlassian.jira.project.Project project,
                                       ViewDefinition view,
                                       java.lang.String key,
                                       WatchedField watchedField)
Deprecated. 

Currently assumes the key passed in is the key used

Specified by:
getCapacity in interface CapacityService2
Parameters:
project - the project a Capacity is stored against
key - The key to find capacities for. This is normally the actual board id, but could also be the column id (task board) and would be null for the default capacities. The Key passed in is the key used.
watchedField - the watched field to get capacity for
Returns:
a Capacity object for the given parameters. Never returns null

setCapacity

public ErrorCollection setCapacity(com.opensymphony.user.User user,
                                   XProject xproject,
                                   ViewDefinition view,
                                   java.lang.String key,
                                   WatchedField watchedField,
                                   Capacity capacity)
Set the capacity min/max values

Specified by:
setCapacity in interface CapacityService2

setDefaultCapacity

public ErrorCollection setDefaultCapacity(com.opensymphony.user.User user,
                                          XProject xproject,
                                          ViewDefinition view,
                                          WatchedField watchedField,
                                          Capacity capacity)
Description copied from interface: CapacityService2
Update the default capacity min/max values with the values currently set in the Capacity object

Specified by:
setDefaultCapacity in interface CapacityService2

removeCapacity

public ErrorCollection removeCapacity(com.opensymphony.user.User user,
                                      XProject xproject,
                                      ViewDefinition view,
                                      java.lang.String key,
                                      WatchedField watchedField)
Removes the capacity for the given parameters.

Specified by:
removeCapacity in interface CapacityService2

removeDefaultCapacity

public ErrorCollection removeDefaultCapacity(com.opensymphony.user.User user,
                                             XProject xproject,
                                             ViewDefinition view,
                                             WatchedField watchedField)
Description copied from interface: CapacityService2
Removes the default capacity for a given xproject and boardType

Specified by:
removeDefaultCapacity in interface CapacityService2

getCapacities

public Capacities getCapacities(com.opensymphony.user.User user,
                                XProject xproject,
                                ViewDefinition view,
                                java.lang.String key,
                                ProjectConfiguration configuration)
Get the capacities object for a collection of watched fields.

Specified by:
getCapacities in interface CapacityService2

getDefaultCapacities

public Capacities getDefaultCapacities(com.opensymphony.user.User user,
                                       XProject xproject,
                                       ViewDefinition view,
                                       ProjectConfiguration configuration)
Get the default capacities object for a collection of watched fields.

Specified by:
getDefaultCapacities in interface CapacityService2


Copyright © 2007-2011 Atlassian. All Rights Reserved.