com.atlassian.greenhopper.service.backlog
Class BacklogServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.backlog.BacklogServiceImpl
All Implemented Interfaces:
BacklogService

@Service(value="gh-backlogService")
public class BacklogServiceImpl
extends java.lang.Object
implements BacklogService

Service for handling all Backlog-related functionality

Author:
ahennecke

Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.backlog.BacklogService
SERVICE
 
Constructor Summary
BacklogServiceImpl()
           
 
Method Summary
 ErrorCollection archiveBacklog(com.opensymphony.user.User user, Backlog backlog)
          Marks the given Backlog as "archived".
 ErrorCollection completeBacklog(com.opensymphony.user.User user, Backlog backlog)
          Marks the given Backlog as "completed".
 ErrorCollection create(com.opensymphony.user.User user, Backlog backlog)
          Creates the given top level backlog object.
 ErrorCollection create(com.opensymphony.user.User user, Backlog backlog, java.lang.Long parentId)
          Creates the given backlog object as a child of the given parent Backlog.
 void createUnscheduled(XProject xproject)
          Creates the unscheduled backlog for given xproject.
 ErrorCollection delete(com.opensymphony.user.User user, java.lang.Long id)
          Delete a backlog.
 Backlog get(com.opensymphony.user.User user, java.lang.Long id)
          Get a backlog given its id taking user permissions into account
 java.util.SortedSet<Backlog> getAll(com.opensymphony.user.User user)
          Returns all backlogs a user has access to.
 java.util.SortedSet<Backlog> getBacklogs(com.opensymphony.user.User user, XProject xproject, Backlog.Status... statuses)
          Get all backlogs for a XProject.
 java.util.List<Backlog> getSortedBacklogs(com.opensymphony.user.User user, XProject xproject, Backlog.Status... statuses)
          Get all backlogs for a XProject, sorted respecting the hierarchy order.
 java.util.List<Backlog> getSortedOpenBacklogs(com.opensymphony.user.User user, XProject xproject)
          Get all backlogs for a XProject, sorted respecting the hierarchy order.
 Backlog getUnscheduled(com.opensymphony.user.User user, XProject xproject)
          Gets the "Unscheduled" default backlog for a XProject.
 boolean isAdmin(com.opensymphony.user.User user, Backlog backlog)
          For convenience so we don't always need to have the XProjectService around when dealing with backlogs (like in JIRA-internals, JQL, ...)
 boolean isBrowsable(com.opensymphony.user.User user, Backlog backlog)
          For convenience so we don't always need to have the XProjectService around when dealing with backlogs (like in JIRA-internals, JQL, ...)
 ErrorCollection reopenBacklog(com.opensymphony.user.User user, Backlog backlog)
          Reopens the given, completed or archived Backlog.
 ErrorCollection save(com.opensymphony.user.User user, Backlog backlog)
          Updates the given backlog object.
 ErrorCollection save(com.opensymphony.user.User user, Backlog backlog, java.lang.Long parentId)
          Updates the given backlog object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BacklogServiceImpl

public BacklogServiceImpl()
Method Detail

get

public Backlog get(com.opensymphony.user.User user,
                   java.lang.Long id)
Description copied from interface: BacklogService
Get a backlog given its id taking user permissions into account

Specified by:
get in interface BacklogService
Parameters:
user - the user requesting the backlog
Returns:
Backlog for the given ID, or null if there is none

getBacklogs

public java.util.SortedSet<Backlog> getBacklogs(com.opensymphony.user.User user,
                                                XProject xproject,
                                                Backlog.Status... statuses)
Description copied from interface: BacklogService
Get all backlogs for a XProject.

Specified by:
getBacklogs in interface BacklogService
statuses - : the statuses the result is limited to. If none are given, an empty set is returned.
Returns:
All Backlogs for the project, an empty set if the user does not have access

getSortedOpenBacklogs

public java.util.List<Backlog> getSortedOpenBacklogs(com.opensymphony.user.User user,
                                                     XProject xproject)
Description copied from interface: BacklogService
Get all backlogs for a XProject, sorted respecting the hierarchy order. NOTE: does not show completed backlogs

Specified by:
getSortedOpenBacklogs in interface BacklogService
Parameters:
user - the user requesting the backlogs
Returns:
All Backlogs for the project, an empty set if the user does not have access

getSortedBacklogs

public java.util.List<Backlog> getSortedBacklogs(com.opensymphony.user.User user,
                                                 XProject xproject,
                                                 Backlog.Status... statuses)
Description copied from interface: BacklogService
Get all backlogs for a XProject, sorted respecting the hierarchy order.

Specified by:
getSortedBacklogs in interface BacklogService
Parameters:
user - the user requesting the backlogs
statuses - : the statuses the result is limited to. If none are given, an empty set is returned.
Returns:
All Backlogs for the project, an empty set if the user does not have access

getAll

public java.util.SortedSet<Backlog> getAll(com.opensymphony.user.User user)
Description copied from interface: BacklogService
Returns all backlogs a user has access to. This will search all XProjects to which a user has browse access to (the user therefore needs browse permission for at least one of the projects contained in the XProject) and returns all backlogs contained in them. If none can be found, an empty set is returned.

Specified by:
getAll in interface BacklogService
Returns:
all backlog entries across all XProjects for which a user has browse permission

getUnscheduled

public Backlog getUnscheduled(com.opensymphony.user.User user,
                              XProject xproject)
Description copied from interface: BacklogService
Gets the "Unscheduled" default backlog for a XProject. This is the one issues are associated to by default.

Specified by:
getUnscheduled in interface BacklogService
Parameters:
user - the user requesting the backlog
Returns:
The unscheduled Backlog or null if the user does not have access

create

public ErrorCollection create(com.opensymphony.user.User user,
                              Backlog backlog)
Description copied from interface: BacklogService
Creates the given top level backlog object. It will have an ID assigned afterwards.

Specified by:
create in interface BacklogService
Returns:
ErrorCollection with error messages, if there were any

create

public ErrorCollection create(com.opensymphony.user.User user,
                              Backlog backlog,
                              java.lang.Long parentId)
Description copied from interface: BacklogService
Creates the given backlog object as a child of the given parent Backlog. It will have an ID assigned afterwards. If the parentId is null, a top level backlog will be created.

Specified by:
create in interface BacklogService
Returns:
ErrorCollection with error messages, if there were any

createUnscheduled

public void createUnscheduled(XProject xproject)
Description copied from interface: BacklogService
Creates the unscheduled backlog for given xproject. It will have an ID assigned afterwards.

Specified by:
createUnscheduled in interface BacklogService

save

public ErrorCollection save(com.opensymphony.user.User user,
                            Backlog backlog)
Description copied from interface: BacklogService
Updates the given backlog object. The ID of the backlog object should exist already. No Hierarchy information is saved.

Specified by:
save in interface BacklogService
Returns:
ErrorCollection with error messages, if there were any

save

public ErrorCollection save(com.opensymphony.user.User user,
                            Backlog backlog,
                            java.lang.Long parentId)
Description copied from interface: BacklogService
Updates the given backlog object. The ID of the backlog object should exist already. If the parentId is null, the backlog will be set to be a top level backlog.

Specified by:
save in interface BacklogService
Returns:
ErrorCollection with error messages, if there were any

delete

public ErrorCollection delete(com.opensymphony.user.User user,
                              java.lang.Long id)
Delete a backlog. Issues of that backlog are automatically moved to either the parent backlog if available or the unscheduled otherwise. Child backlogs are automatically assigned to the parent backlog or converted to a top level backlog if the deleted backlog does not have a parent.

Specified by:
delete in interface BacklogService
Returns:
ErrorCollection with error messages, if there were any

isBrowsable

public boolean isBrowsable(com.opensymphony.user.User user,
                           Backlog backlog)
For convenience so we don't always need to have the XProjectService around when dealing with backlogs (like in JIRA-internals, JQL, ...)

Specified by:
isBrowsable in interface BacklogService

isAdmin

public boolean isAdmin(com.opensymphony.user.User user,
                       Backlog backlog)
For convenience so we don't always need to have the XProjectService around when dealing with backlogs (like in JIRA-internals, JQL, ...)

Specified by:
isAdmin in interface BacklogService

completeBacklog

public ErrorCollection completeBacklog(com.opensymphony.user.User user,
                                       Backlog backlog)
Description copied from interface: BacklogService
Marks the given Backlog as "completed". Backlogs marked as this can't be edited anymore, but still show up in statistics.

Specified by:
completeBacklog in interface BacklogService

archiveBacklog

public ErrorCollection archiveBacklog(com.opensymphony.user.User user,
                                      Backlog backlog)
Description copied from interface: BacklogService
Marks the given Backlog as "archived". Backlogs marked as this aren't used anymore in GreenHopper.

Specified by:
archiveBacklog in interface BacklogService

reopenBacklog

public ErrorCollection reopenBacklog(com.opensymphony.user.User user,
                                     Backlog backlog)
Description copied from interface: BacklogService
Reopens the given, completed or archived Backlog.

Specified by:
reopenBacklog in interface BacklogService


Copyright © 2007-2011 Atlassian. All Rights Reserved.