com.atlassian.jira.issue.managers
Class DefaultIssueManager

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

public class DefaultIssueManager
extends java.lang.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(java.lang.String remoteUserName, java.util.Map fields)
          This method is here because this is a logical place for the "createIssue" method to be.
 org.ofbiz.core.entity.GenericValue createIssue(com.opensymphony.user.User remoteUser, java.util.Map fields)
          This function creates an issue in Jira.
 java.util.Collection execute(SearchRequest searchRequest, com.opensymphony.user.User searcher)
          Takes a search request object and returns a list of issues that match the search request
 java.util.List getEntitiesByIssue(java.lang.String relationName, org.ofbiz.core.entity.GenericValue issue)
          Get a list of entities related to this issue by their relationship name.
 org.ofbiz.core.entity.GenericValue getIssue(java.lang.Long id)
           
 org.ofbiz.core.entity.GenericValue getIssue(java.lang.String key)
           
 org.ofbiz.core.entity.GenericValue getIssueByWorkflow(java.lang.Long wfid)
           
 java.util.List getIssuesByEntity(java.lang.String relationName, org.ofbiz.core.entity.GenericValue entity)
          Get a list of issues related to this entity by their relationship name.
 java.util.List getIssueWatchers(org.ofbiz.core.entity.GenericValue issue)
          Return a list of users that are watching an issue.
 java.util.List getProjectIssues(org.ofbiz.core.entity.GenericValue project)
          Get all the issues for a given project.
 java.util.List getVotedIssues(com.opensymphony.user.User user)
          Retrieves all the issues a user has voted for.
 java.util.List getWatchedIssues(com.opensymphony.user.User user)
           
 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(java.lang.Long id)
                                            throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getIssue in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssue

public org.ofbiz.core.entity.GenericValue getIssue(java.lang.String key)
                                            throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getIssue in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssueByWorkflow

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

getEntitiesByIssue

public java.util.List getEntitiesByIssue(java.lang.String relationName,
                                         org.ofbiz.core.entity.GenericValue issue)
                                  throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueManager
Get a list of entities related to this issue by their relationship name. Example relation names include IssueRelationConstants.VERSION, IssueRelationConstants.COMPONENT - IssueRelationConstants

Specified by:
getEntitiesByIssue in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssuesByEntity

public java.util.List getIssuesByEntity(java.lang.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 this entity by their relationship name. Example relation names include IssueRelationConstants.VERSION, IssueRelationConstants.COMPONENT - IssueRelationConstants

Specified by:
getIssuesByEntity in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException

createIssue

public org.ofbiz.core.entity.GenericValue createIssue(com.opensymphony.user.User remoteUser,
                                                      java.util.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

getProjectIssues

public java.util.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
Throws:
org.ofbiz.core.entity.GenericEntityException

createIssue

public org.ofbiz.core.entity.GenericValue createIssue(java.lang.String remoteUserName,
                                                      java.util.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 java.util.List getVotedIssues(com.opensymphony.user.User user)
                              throws org.ofbiz.core.entity.GenericEntityException,
                                     com.opensymphony.user.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
com.opensymphony.user.EntityNotFoundException

getIssueWatchers

public java.util.List getIssueWatchers(org.ofbiz.core.entity.GenericValue issue)
                                throws org.ofbiz.core.entity.GenericEntityException,
                                       com.opensymphony.user.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
com.opensymphony.user.EntityNotFoundException

getWatchedIssues

public java.util.List getWatchedIssues(com.opensymphony.user.User user)
                                throws org.ofbiz.core.entity.GenericEntityException,
                                       com.opensymphony.user.EntityNotFoundException
Specified by:
getWatchedIssues in interface IssueManager
Throws:
org.ofbiz.core.entity.GenericEntityException
com.opensymphony.user.EntityNotFoundException

execute

public java.util.Collection execute(SearchRequest searchRequest,
                                    com.opensymphony.user.User searcher)
                             throws SearchException
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
Returns:
A List of Issues that match the search request
Throws:
SearchException


Copyright © 2002-2006 Atlassian. All Rights Reserved.