com.atlassian.jira.user
Class DefaultUserIssueHistoryManager

java.lang.Object
  extended by com.atlassian.jira.user.DefaultUserIssueHistoryManager
All Implemented Interfaces:
UserIssueHistoryManager

public class DefaultUserIssueHistoryManager
extends java.lang.Object
implements UserIssueHistoryManager

A convenience wrapper around the UserHistoryManager to work directly with issues and perform permission checks

Since:
v4.0

Field Summary
 
Fields inherited from interface com.atlassian.jira.user.UserIssueHistoryManager
DEFAULT_ISSUE_HISTORY_DROPDOWN_ITEMS
 
Constructor Summary
DefaultUserIssueHistoryManager(UserHistoryManager userHistoryManager, PermissionManager permissionManager, IssueManager issueManager, ApplicationProperties applicationProperties)
           
 
Method Summary
 void addIssueToHistory(com.opensymphony.user.User user, Issue issue)
          Add an Issue to the user hsitory list.
 java.util.List<UserHistoryItem> getFullIssueHistoryWithoutPermissionChecks(com.opensymphony.user.User user)
          Retreive the user's issue history queue.
 java.util.List<UserHistoryItem> getFullIssueHistoryWithPermissionChecks(com.opensymphony.user.User user)
          Retreive the user's issue history queue.
 java.util.List<Issue> getShortIssueHistory(com.opensymphony.user.User user)
          Retreive the first X (jira.max.issue.history.dropdown.items) Issues from the user's issue history queue.
 boolean hasIssueHistory(com.opensymphony.user.User user)
          Determines whether the user has a current issue history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUserIssueHistoryManager

public DefaultUserIssueHistoryManager(UserHistoryManager userHistoryManager,
                                      PermissionManager permissionManager,
                                      IssueManager issueManager,
                                      ApplicationProperties applicationProperties)
Method Detail

addIssueToHistory

public void addIssueToHistory(@NotNull
                              com.opensymphony.user.User user,
                              @NotNull
                              Issue issue)
Description copied from interface: UserIssueHistoryManager
Add an Issue to the user hsitory list. A null users history should still be stored, even if only for duration of session

Specified by:
addIssueToHistory in interface UserIssueHistoryManager
Parameters:
user - The user to add the history item to
issue - The issue to add to the history list

hasIssueHistory

public boolean hasIssueHistory(com.opensymphony.user.User user)
Description copied from interface: UserIssueHistoryManager
Determines whether the user has a current issue history. This method also performs permission checks against issue to ensure that user can see atleast 1 issue.

Specified by:
hasIssueHistory in interface UserIssueHistoryManager
Parameters:
user - The user to check for.
Returns:
true if the user has at least 1 issue in their issue history queue that they can see, false otherwise

getFullIssueHistoryWithoutPermissionChecks

@NotNull
public java.util.List<UserHistoryItem> getFullIssueHistoryWithoutPermissionChecks(com.opensymphony.user.User user)
Description copied from interface: UserIssueHistoryManager
Retreive the user's issue history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs no permission checks.

Specified by:
getFullIssueHistoryWithoutPermissionChecks in interface UserIssueHistoryManager
Parameters:
user - The user to get the history issue items for.
Returns:
a list of history issue items sort by desc lastViewed date.

getFullIssueHistoryWithPermissionChecks

public java.util.List<UserHistoryItem> getFullIssueHistoryWithPermissionChecks(com.opensymphony.user.User user)
Description copied from interface: UserIssueHistoryManager
Retreive the user's issue history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.

Specified by:
getFullIssueHistoryWithPermissionChecks in interface UserIssueHistoryManager
Parameters:
user - The user to get the history issue items for.
Returns:
a list of history issue items sort by desc lastViewed date.

getShortIssueHistory

@NotNull
public java.util.List<Issue> getShortIssueHistory(com.opensymphony.user.User user)
Description copied from interface: UserIssueHistoryManager
Retreive the first X (jira.max.issue.history.dropdown.items) Issues from the user's issue history queue. This purpose of this method is to return a small list for easy display. The filtering could be done in the view code, but for performance reasons, is done here. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.

Specified by:
getShortIssueHistory in interface UserIssueHistoryManager
Parameters:
user - The user to get the history issue items for.
Returns:
a list of issue items sorted by desc lastViewed date.


Copyright © 2002-2010 Atlassian. All Rights Reserved.