com.atlassian.greenhopper.service.backlog
Class BacklogCustomFieldServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.backlog.BacklogCustomFieldServiceImpl
All Implemented Interfaces:
BacklogCustomFieldService

@Service(value="gh-backlogCustomFieldService")
public class BacklogCustomFieldServiceImpl
extends java.lang.Object
implements BacklogCustomFieldService


Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.backlog.BacklogCustomFieldService
SERVICE
 
Constructor Summary
BacklogCustomFieldServiceImpl()
           
 
Method Summary
 void connect(com.opensymphony.user.User user, com.atlassian.jira.issue.Issue issue, Backlog backlog)
          Connects an issue to a backlog Checks permissions
 void disconnect(com.opensymphony.user.User user, java.util.Set<com.atlassian.jira.project.Project> projects)
          Disconnects all issues of the passed in projects Bypasses permissions because this is always called by the system
 com.atlassian.jira.issue.fields.CustomField getBacklogField()
          Lazily create the field if necessary.
 Backlog getBacklogFromIssue(com.atlassian.jira.issue.Issue issue)
          Get backlog from issue
 com.atlassian.jira.issue.fields.CustomField getBacklogHistoryField()
          Get the CustomField used to store which backlogs an issue has been associated with Note: The CustomField is automatically created if it doesn't yet exist or has been deleted
 void moveAllIssues(com.opensymphony.user.User user, Backlog source, Backlog target)
          Set the backlog to all issues that are currently associated with source Bypasses permissions because this is always called by the system
 void removeFromHistory(com.opensymphony.user.User user, Backlog backlog)
          Find all issues that have a history with this backlog and remove that information.
 void repair(XProject xproject)
          Repairs the passed in xproject by associating all non-associated issues with the provide unscheduled backlog.
 void repair(XProject xproject, com.atlassian.jira.issue.Issue issue)
          This is a singular operation on one issue.
 void saveToHistory(com.opensymphony.user.User user, com.atlassian.jira.issue.Issue issue, Backlog backlog)
          The backlog history is an internal field, so we don't really want to have changelog entries or anything like that.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BacklogCustomFieldServiceImpl

public BacklogCustomFieldServiceImpl()
Method Detail

connect

public void connect(com.opensymphony.user.User user,
                    com.atlassian.jira.issue.Issue issue,
                    Backlog backlog)
Connects an issue to a backlog Checks permissions

Specified by:
connect in interface BacklogCustomFieldService

moveAllIssues

public void moveAllIssues(com.opensymphony.user.User user,
                          Backlog source,
                          Backlog target)
Set the backlog to all issues that are currently associated with source Bypasses permissions because this is always called by the system

Specified by:
moveAllIssues in interface BacklogCustomFieldService

disconnect

public void disconnect(com.opensymphony.user.User user,
                       java.util.Set<com.atlassian.jira.project.Project> projects)
Disconnects all issues of the passed in projects Bypasses permissions because this is always called by the system

Specified by:
disconnect in interface BacklogCustomFieldService
Parameters:
projects - a set of projects that are no longer part of an XProject and whose issues therefore need to be disconnected

repair

public void repair(XProject xproject)
Repairs the passed in xproject by associating all non-associated issues with the provide unscheduled backlog.

Specified by:
repair in interface BacklogCustomFieldService
Parameters:
xproject - the xproject to repair

repair

public void repair(XProject xproject,
                   com.atlassian.jira.issue.Issue issue)
This is a singular operation on one issue. If there are several / an unknown number of issues involved, prefer using repair(xproject)

Specified by:
repair in interface BacklogCustomFieldService

getBacklogFromIssue

public Backlog getBacklogFromIssue(com.atlassian.jira.issue.Issue issue)
Description copied from interface: BacklogCustomFieldService
Get backlog from issue

Specified by:
getBacklogFromIssue in interface BacklogCustomFieldService
Returns:
the backlog matching the backlog custom field value on the issue, or null

getBacklogField

public com.atlassian.jira.issue.fields.CustomField getBacklogField()
Lazily create the field if necessary. Admins can delete the darned thing, which will effectively remove all their data, but at least we create it again here and GH works still.

Specified by:
getBacklogField in interface BacklogCustomFieldService

getBacklogHistoryField

public com.atlassian.jira.issue.fields.CustomField getBacklogHistoryField()
Description copied from interface: BacklogCustomFieldService
Get the CustomField used to store which backlogs an issue has been associated with Note: The CustomField is automatically created if it doesn't yet exist or has been deleted

Specified by:
getBacklogHistoryField in interface BacklogCustomFieldService

saveToHistory

public void saveToHistory(com.opensymphony.user.User user,
                          com.atlassian.jira.issue.Issue issue,
                          Backlog backlog)
The backlog history is an internal field, so we don't really want to have changelog entries or anything like that.

Specified by:
saveToHistory in interface BacklogCustomFieldService
issue - : The issue that's being carried on
backlog - : The backlog that the issue is moved out of

removeFromHistory

public void removeFromHistory(com.opensymphony.user.User user,
                              Backlog backlog)
Find all issues that have a history with this backlog and remove that information. Low-level operation.

Specified by:
removeFromHistory in interface BacklogCustomFieldService
backlog - : The backlog that gets removed from the history


Copyright © 2007-2011 Atlassian. All Rights Reserved.