com.atlassian.jira.issue.managers
Class DefaultIssueManager

java.lang.Object
  extended bycom.atlassian.jira.issue.managers.DefaultIssueManager
All Implemented Interfaces:
IssueManager, JiraManager

public class DefaultIssueManager
extends Object
implements IssueManager


Constructor Summary
DefaultIssueManager(WorkflowManager workflowManager, com.atlassian.core.ofbiz.association.AssociationManager associationManager, TextAnalyzer textAnalyzer)
           
 
Method Summary
 org.ofbiz.core.entity.GenericValue createIssue(String remoteUserName, Map fields)
          This method is here because this is a logical place for the "createIssue" method to be.
 org.ofbiz.core.entity.GenericValue createIssue(User remoteUser, Issue issue)
           
 org.ofbiz.core.entity.GenericValue createIssue(User remoteUser, Map fields)
          This function creates an issue in Jira.
 List execute(SearchRequest searchRequest, User searcher)
          Deprecated. Please use SearchProvider.search(SearchRequest, com.opensymphony.user.User, com.atlassian.jira.web.bean.PagerFilter) instead, which returns Issues.
 List getEntitiesByIssue(String relationName, org.ofbiz.core.entity.GenericValue issue)
          Get a list of entities (versions, components etc) related to this issue.
 List getEntitiesByIssueObject(String relationName, Issue issue)
          Get a list of entities (versions, components etc) related to this issue.
 org.ofbiz.core.entity.GenericValue getIssue(Long id)
           
 org.ofbiz.core.entity.GenericValue getIssue(String key)
          Retrieves the issue as a GenericValue with the given key.
 org.ofbiz.core.entity.GenericValue getIssueByWorkflow(Long wfid)
           
 Collection getIssueIdsForProject(Long projectId)
          Retrieve a collection of all issue ids that belong to a given project.
 MutableIssue getIssueObject(Long id)
           
 MutableIssue getIssueObject(String key)
          Retrieves the Issue that has the given key.
 List getIssues(Collection ids)
          Get issues with the following ids.
 List getIssuesByEntity(String relationName, org.ofbiz.core.entity.GenericValue entity)
          Get a list of issues related to an entity (version, component etc).
 List getIssueWatchers(org.ofbiz.core.entity.GenericValue issue)
          Return a list of users that are watching an issue.
 List getIssueWatchers(Issue issue)
           
 List getProjectIssues(org.ofbiz.core.entity.GenericValue project)
          Get all the issues for a given project.
 List getVotedIssues(User user)
          Retrieves all the issues a user has voted for.
 List getWatchedIssues(User user)
          Get a list of issues that the user is watching
 boolean isEditable(Issue issue)
          Returns whether the issue can be edited.
 void notifyTrackbacks(org.ofbiz.core.entity.GenericValue issue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIssueManager

public DefaultIssueManager(WorkflowManager workflowManager,
                           com.atlassian.core.ofbiz.association.AssociationManager associationManager,
                           TextAnalyzer textAnalyzer)
Method Detail

getIssue

public org.ofbiz.core.entity.GenericValue getIssue(Long id)
                                            throws DataAccessException
Specified by:
getIssue in interface IssueManager
Throws:
DataAccessException

getIssue

public org.ofbiz.core.entity.GenericValue getIssue(String key)
                                            throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueManager
Retrieves the issue as a GenericValue with the given key.

Specified by:
getIssue in interface IssueManager
Parameters:
key - the issue key.
Returns:
the issue as a GenericValue.
Throws:
org.ofbiz.core.entity.GenericEntityException - if there is a problem getting the data

getIssues

public List getIssues(Collection ids)
Description copied from interface: IssueManager
Get issues with the following ids. The issues are sorted in the order that the ids were given in.

Specified by:
getIssues in interface IssueManager

getIssueIdsForProject

public Collection getIssueIdsForProject(Long projectId)
                                 throws org.ofbiz.core.entity.GenericEntityException
Retrieve a collection of all issue ids that belong to a given project.

Specified by:
getIssueIdsForProject in interface IssueManager
Parameters:
projectId - the id of the project for which to retrieve all issue ids
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssueByWorkflow

public org.ofbiz.core.entity.GenericValue getIssueByWorkflow(Long wfid)
                                                      throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getIssueByWorkflow in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssueObject

public MutableIssue getIssueObject(Long id)
                            throws DataAccessException
Specified by:
getIssueObject in interface IssueManager
Throws:
DataAccessException

getIssueObject

public MutableIssue getIssueObject(String key)
                            throws DataAccessException
Description copied from interface: IssueManager
Retrieves the Issue that has the given key.

Specified by:
getIssueObject in interface IssueManager
Parameters:
key - the key.
Returns:
the issue.
Throws:
DataAccessException - if a matching issue cannot be found.

getEntitiesByIssue

public List getEntitiesByIssue(String relationName,
                               org.ofbiz.core.entity.GenericValue issue)
                        throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueManager
Get a list of entities (versions, components etc) related to this issue.

Specified by:
getEntitiesByIssue in interface IssueManager
Parameters:
relationName - A IssueRelationConstants string indicating some issue relation
issue - Issue to consider
Returns:
A list of entity GenericValues associated with the issue.
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntitiesByIssueObject

public List getEntitiesByIssueObject(String relationName,
                                     Issue issue)
                              throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueManager
Get a list of entities (versions, components etc) related to this issue.

Specified by:
getEntitiesByIssueObject in interface IssueManager
Parameters:
relationName - A IssueRelationConstants string indicating some issue relation
issue - Issue to consider
Returns:
A list of entity GenericValues associated with the issue.
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssuesByEntity

public List getIssuesByEntity(String relationName,
                              org.ofbiz.core.entity.GenericValue entity)
                       throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueManager
Get a list of issues related to an entity (version, component etc).

Specified by:
getIssuesByEntity in interface IssueManager
Parameters:
relationName - A IssueRelationConstants string indicating some relation of entity
entity - The entity related to the issues we're after
Returns:
A list of issue GenericValues associated with an entity.
Throws:
org.ofbiz.core.entity.GenericEntityException

createIssue

public org.ofbiz.core.entity.GenericValue createIssue(User remoteUser,
                                                      Map fields)
                                               throws CreateException
This function creates an issue in Jira. Read the javadoc under the fields parameter to see what object need to be passed to create an issue.

Specified by:
createIssue in interface IssueManager
Parameters:
remoteUser - User that is creating this issue
fields - see below

Required Fields

projectId: A Long value representing the id of the project
issueType: The String id of an issueType
summary: A String describing the issue (max 255 chars)

Recomended Fields

assignee: A String representing the username of the assignee
reporter: A String representing the username of the reporter
priority: The String id of a priority

Optional Fields

description: A String description of the issue
environment: A String description of the environment the issue is in. e.g W2K
fixVersions: A List of Long values representing fixVersion ids
components: A List of Long values representing component ids
timeOriginalEstimate: A Long value representing the number of seconds this tast should take
timeEstimate: A Long value representing the number of seconds allocated for this issue
versions: = A List of Long value representing version ids
customFields: A Map with the CustomField as the key and Transport Object of the CF as the value
created: The date which the issue was created. If not specified, defaults to System.currentTimeMillis()
updated: The date which the issue was updated. If not specified, defaults to System.currentTimeMillis()
Returns:
A generic value representing the issue created
Throws:
CreateException
See Also:
IssueCreateFunction

createIssue

public org.ofbiz.core.entity.GenericValue createIssue(User remoteUser,
                                                      Issue issue)
                                               throws CreateException
Specified by:
createIssue in interface IssueManager
Throws:
CreateException

getProjectIssues

public List getProjectIssues(org.ofbiz.core.entity.GenericValue project)
                      throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueManager
Get all the issues for a given project.

Specified by:
getProjectIssues in interface IssueManager
Returns:
a List of GenericValue objects
Throws:
org.ofbiz.core.entity.GenericEntityException

isEditable

public boolean isEditable(Issue issue)
Description copied from interface: IssueManager
Returns whether the issue can be edited. This is determined by looking at the workflow step the issue is in.

Specified by:
isEditable in interface IssueManager

createIssue

public org.ofbiz.core.entity.GenericValue createIssue(String remoteUserName,
                                                      Map fields)
                                               throws CreateException
This method is here because this is a logical place for the "createIssue" method to be. As the issues are actually created using workflow, the current implementation of this method uses the WorkflowManager to create the issue

Specified by:
createIssue in interface IssueManager
Parameters:
remoteUserName - the user who is creating the issue
fields - issue's attribute's
Returns:
the created issue
Throws:
CreateException
See Also:
createIssue(com.opensymphony.user.User, java.util.Map)

notifyTrackbacks

public void notifyTrackbacks(org.ofbiz.core.entity.GenericValue issue)

getVotedIssues

public List getVotedIssues(User user)
                    throws org.ofbiz.core.entity.GenericEntityException,
                           EntityNotFoundException
Retrieves all the issues a user has voted for.

Specified by:
getVotedIssues in interface IssueManager
Parameters:
user - The user that has voted
Returns:
List of Issues the user has voted on
Throws:
org.ofbiz.core.entity.GenericEntityException
EntityNotFoundException

getIssueWatchers

public List getIssueWatchers(org.ofbiz.core.entity.GenericValue issue)
                      throws org.ofbiz.core.entity.GenericEntityException,
                             EntityNotFoundException
Return a list of users that are watching an issue.

Specified by:
getIssueWatchers in interface IssueManager
Parameters:
issue - The issue
Returns:
List of Users
Throws:
org.ofbiz.core.entity.GenericEntityException
EntityNotFoundException

getIssueWatchers

public List getIssueWatchers(Issue issue)
                      throws org.ofbiz.core.entity.GenericEntityException,
                             EntityNotFoundException
Specified by:
getIssueWatchers in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException
EntityNotFoundException

getWatchedIssues

public List getWatchedIssues(User user)
                      throws org.ofbiz.core.entity.GenericEntityException,
                             EntityNotFoundException
Description copied from interface: IssueManager
Get a list of issues that the user is watching

Specified by:
getWatchedIssues in interface IssueManager
Returns:
A list of Issue objects
Throws:
org.ofbiz.core.entity.GenericEntityException
EntityNotFoundException

execute

public List execute(SearchRequest searchRequest,
                    User searcher)
             throws SearchException
Deprecated. Please use SearchProvider.search(SearchRequest, com.opensymphony.user.User, com.atlassian.jira.web.bean.PagerFilter) instead, which returns Issues.

Takes a search request object and returns a list of issues that match the search request

Specified by:
execute in interface IssueManager
Parameters:
searchRequest - object to be used to search for
searcher - User who is running the search. Make sure this user has permissions to see the issues you want!
Returns:
A List of GenericValues that match the search request
Throws:
SearchException


Copyright © 2002-2007 Atlassian. All Rights Reserved.