com.atlassian.jira.user
Interface UserProjectHistoryManager

All Known Implementing Classes:
DefaultUserProjectHistoryManager

public interface UserProjectHistoryManager

A wrapper of the UserHistoryManager that allows you to deal directly with Project objects

Since:
v4.0

Method Summary
 void addProjectToHistory(com.atlassian.crowd.embedded.api.User user, Project project)
          Add a Project to the user hsitory list.
 Project getCurrentProject(int permission, com.atlassian.crowd.embedded.api.User user)
          Gets the last viewed project that the user visted and still has permission to see.
 List<UserHistoryItem> getProjectHistoryWithoutPermissionChecks(com.atlassian.crowd.embedded.api.User user)
          Retreive the user's project history queue.
 List<Project> getProjectHistoryWithPermissionChecks(int permission, com.atlassian.crowd.embedded.api.User user)
          Deprecated. since 4.4, use {#getProjectHistoryWithPermissionChecks(ProjectAction, User)}
 List<Project> getProjectHistoryWithPermissionChecks(ProjectAction projectAction, com.atlassian.crowd.embedded.api.User user)
          Retreive the user's project history queue.
 boolean hasProjectHistory(int permission, com.atlassian.crowd.embedded.api.User user)
          Determines whether the user has a current project history.
 

Method Detail

addProjectToHistory

void addProjectToHistory(com.atlassian.crowd.embedded.api.User user,
                         Project project)
Add a Project to the user hsitory list. A null users history should still be stored, even if only for duration of session

Parameters:
user - The user to add the history item to
project - The project to add to the history list

hasProjectHistory

boolean hasProjectHistory(int permission,
                          com.atlassian.crowd.embedded.api.User user)
Determines whether the user has a current project history. This method also performs permission checks against the project to ensure that user can see atleast 1 project.

Parameters:
permission - the permission to check against
user - The user to check for.
Returns:
true if the user has at least 1 project in their project history queue that they can see, false otherwise

getCurrentProject

Project getCurrentProject(int permission,
                          com.atlassian.crowd.embedded.api.User user)
Gets the last viewed project that the user visted and still has permission to see. This method also performs permission checks against the project to ensure that user can see it.

Parameters:
permission - the permission the user must have for the project
user - The user to get teh history for.
Returns:
the last project the use visited.

getProjectHistoryWithoutPermissionChecks

@Nonnull
List<UserHistoryItem> getProjectHistoryWithoutPermissionChecks(com.atlassian.crowd.embedded.api.User user)
Retreive the user's project history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs no permission checks. And is extremely fast.

Parameters:
user - The user to get the history project items for.
Returns:
a list of history project items sort by desc lastViewed date.

getProjectHistoryWithPermissionChecks

@Nonnull
List<Project> getProjectHistoryWithPermissionChecks(int permission,
                                                            com.atlassian.crowd.embedded.api.User user)
Deprecated. since 4.4, use {#getProjectHistoryWithPermissionChecks(ProjectAction, User)}

Retreive the user's project history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.

Parameters:
permission - The permission the user must have for the project
user - The user to get the history project items for.
Returns:
a list of projects sort by desc lastViewed date.

getProjectHistoryWithPermissionChecks

@Nonnull
List<Project> getProjectHistoryWithPermissionChecks(ProjectAction projectAction,
                                                            com.atlassian.crowd.embedded.api.User user)
Retreive the user's project history queue. The list is returned ordered by DESC lastViewed date (i.e. newest is first). This method performs permission checks.

Parameters:
projectAction - The projectAction the user must have for the project
user - The user to get the history project items for.
Returns:
a list of projects sort by desc lastViewed date.


Copyright © 2002-2014 Atlassian. All Rights Reserved.