com.atlassian.jira.issue.worklog
Class DefaultWorklogManager

java.lang.Object
  extended by com.atlassian.jira.issue.worklog.DefaultWorklogManager
All Implemented Interfaces:
WorklogManager

public class DefaultWorklogManager
extends Object
implements WorklogManager


Constructor Summary
DefaultWorklogManager(IssueManager issueManager, TextAnalyzer textAnalyzer, ProjectRoleManager projectRoleManager, IssueUpdater issueUpdater)
           
 
Method Summary
 Worklog create(User user, Worklog worklog, Long newEstimate, Issue issue, boolean dispatchEvent)
          Creates a worklog based on the passed in Worklog object and associates it with the given issue.
 ProjectRole getProjectRole(Long projectRoleId)
          This is a convenience method to allow us to easily get a ProjectRole.
 List getWorklogsForUser(Issue issue, User user)
          Return a List of Worklogs that the user has the permission to see.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWorklogManager

public DefaultWorklogManager(IssueManager issueManager,
                             TextAnalyzer textAnalyzer,
                             ProjectRoleManager projectRoleManager,
                             IssueUpdater issueUpdater)
Method Detail

getWorklogsForUser

public List getWorklogsForUser(Issue issue,
                               User user)
Description copied from interface: WorklogManager
Return a List of Worklogs that the user has the permission to see.

Specified by:
getWorklogsForUser in interface WorklogManager
Parameters:
issue - the worklogs are associated with.
user - the user whose permission level will be used to limit the worklogs returned.
Returns:
list of Worklogs ordered via the IssueActionComparator.COMPARATOR.

create

public Worklog create(User user,
                      Worklog worklog,
                      Long newEstimate,
                      Issue issue,
                      boolean dispatchEvent)
               throws JiraException,
                      PermissionException
Description copied from interface: WorklogManager
Creates a worklog based on the passed in Worklog object and associates it with the given issue.

The creation date of the worklog will be the date set in the Worklog.timePerformed field. If you have provided a groupLevel then the worklog visibility will be restricted to the provided group, it is assumed that validation to insure that the group actually exists has been performed outside of this method. If you have provided a roleLevelId then the worklog visibility will be restricted to the provided role, it is assumed that validation to insure that the role actually exists has been performed outside of this method.

Specified by:
create in interface WorklogManager
Parameters:
user - is the user who is trying to create the worklog, this can be different than the user identified by Worklog.author. The worklog will only be created if this user has the Permissions.WORK_ISSUE permission for the context identified by the provided issue.
worklog - the object used to provide the parameters that will be used to create the worklog.
newEstimate - will be used to set the time estimate for this worklog.
issue - the issue the worklog will be associated with.
dispatchEvent - if true then an event of type EventType.ISSUE_WORKLOGGED_ID will be dispatched and any notifications listening for that event will be triggered. If false no event will be dispatched.
Returns:
a Worklog object that represents the newly created worklog.
Throws:
PermissionException - if the user does not have the permission to log work in the context identified by the provided Issue.
JiraException - if something goes wrong during the storing of the worklog.

getProjectRole

public ProjectRole getProjectRole(Long projectRoleId)
Description copied from interface: WorklogManager
This is a convenience method to allow us to easily get a ProjectRole. This is being used by the CommentImpl to get a ProjectRole.

NOTE: If you are trying to retrieve a ProjectRole then you should be using the ProjectRoleManager.

Specified by:
getProjectRole in interface WorklogManager
Parameters:
projectRoleId - the id to the ProjectRole object you would like returned.
Returns:
will return a ProjectRole based on the passed in projectRoleId.


Copyright © 2002-2007 Atlassian. All Rights Reserved.