com.atlassian.bamboo.plan
Interface PlanFavouriteService

All Known Implementing Classes:
PlanFavouriteServiceImpl

public interface PlanFavouriteService

Service for managing the plan 'favourite' flag. Methods of this service should not be called from within transaction.


Method Summary
 int addFavourite(Plan plan, com.atlassian.user.User user, boolean honourManuallyUnmarked)
          Mark plan as a favourite for a user.
 boolean isFavourite(Plan plan, com.atlassian.user.User user)
          Test if plan is set as favourite for a user.
 int removeFavourite(Plan plan, com.atlassian.user.User user)
          Remove plan from the user's favourite list and mark it "manually marked not favourite"
 int toggleFavourite(Plan plan, com.atlassian.user.User user)
          Toggle the plan's favourite status for a user.
 

Method Detail

isFavourite

boolean isFavourite(@NotNull
                    Plan plan,
                    @Nullable
                    com.atlassian.user.User user)
Test if plan is set as favourite for a user.

Parameters:
plan - Plan to be tested
user - User whose favourite plans would be examined
Returns:
True if plan is marked as favourite for a user, false otherwise.

addFavourite

int addFavourite(@NotNull
                 Plan plan,
                 @Nullable
                 com.atlassian.user.User user,
                 boolean honourManuallyUnmarked)
Mark plan as a favourite for a user. If the honourManuallyUnmarked flag is set, plan is verified if it is not "manually marked not favourite". If the latter is true then plan is not marked favourite.

Parameters:
plan - Plan to be marked as a favourite
user - User whose favourites will be modified
honourManuallyUnmarked - If this flag is set then additional check is per
Returns:
Status of operation as specified in LabelManager

removeFavourite

int removeFavourite(@NotNull
                    Plan plan,
                    @Nullable
                    com.atlassian.user.User user)
Remove plan from the user's favourite list and mark it "manually marked not favourite"

Parameters:
plan - Plan to be marked as a favourite
user - User whose favourites will be modified
Returns:
Status of operation as specified in LabelManager

toggleFavourite

int toggleFavourite(@NotNull
                    Plan plan,
                    @Nullable
                    com.atlassian.user.User user)
Toggle the plan's favourite status for a user. Depending on the current 'favourite' status either addFavourite or removeFavourite is executed internally. This operation was pulled to this service to make it atomic.

Parameters:
plan - Plan which favourite status will be set/cleared
user - User whose favourites will be modified
Returns:
Status of operation as specified in LabelManager


Copyright © 2011 Atlassian. All Rights Reserved.