com.atlassian.jira.bc.favourites
Interface FavouritesService

All Known Implementing Classes:
DefaultFavouritesService

public interface FavouritesService

Service for basic Favourites functionality. Used for adding, removing and checking favourites of generic entities. Initially used by SearchRequests and Dashboards but can be easily extended.

Since:
v3.13

Method Summary
 void addFavourite(JiraServiceContext ctx, SharedEntity entity)
          Add the given entity as a favourite of the user passed in the context
 void addFavouriteInPosition(JiraServiceContext ctx, SharedEntity entity, long position)
          Add the given entity as a favourite of the user passed in the context and place it in the specified position.
 boolean isFavourite(com.opensymphony.user.User user, SharedEntity entity)
          Check that the given entity is a favourite of the user passed in the context
 void removeFavourite(JiraServiceContext ctx, SharedEntity entity)
          Remove the given entity as a favourite of the user passed in the context
 

Method Detail

addFavourite

void addFavourite(JiraServiceContext ctx,
                  SharedEntity entity)
Add the given entity as a favourite of the user passed in the context

Parameters:
ctx - JIRA Service context
entity - The entity to favourite

addFavouriteInPosition

void addFavouriteInPosition(JiraServiceContext ctx,
                            SharedEntity entity,
                            long position)
Add the given entity as a favourite of the user passed in the context and place it in the specified position. The entity currently in the specified position and all those after will be moved down one position.

Parameters:
ctx - JIRA Service Context holding the current user
entity - the entity to favourite
position - the position in which this entity should be added in the favourites order.

removeFavourite

void removeFavourite(JiraServiceContext ctx,
                     SharedEntity entity)
Remove the given entity as a favourite of the user passed in the context

Parameters:
ctx - JIRA Service context
entity - The entity to unfavourite

isFavourite

boolean isFavourite(com.opensymphony.user.User user,
                    SharedEntity entity)
Check that the given entity is a favourite of the user passed in the context

Parameters:
user - the user to check for
entity - The entity to check favourite
Returns:
true if entity is a favourite, otherwise false


Copyright © 2002-2010 Atlassian. All Rights Reserved.