public class CachingFavouritesStore extends Object implements FavouritesStore, Startable
| Constructor and Description |
|---|
CachingFavouritesStore(FavouritesStore delegateStore,
com.atlassian.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addFavourite(ApplicationUser user,
SharedEntity entity)
Create Favourites association between User and entity
|
Collection<Long> |
getFavouriteIds(ApplicationUser user,
SharedEntity.TypeDescriptor<?> entityType)
Get the ids of a user's favourite Entities for a given entity type
|
Collection<Long> |
getFavouriteIds(String userKey,
SharedEntity.TypeDescriptor<?> entityType)
Get the ids of a user's favourite Entities for a given entity type
|
boolean |
isFavourite(ApplicationUser user,
SharedEntity entity)
Checks to see if entity is a favourite of the user passed in.
|
void |
onClearCache(ClearCacheEvent event) |
boolean |
removeFavourite(ApplicationUser user,
SharedEntity entity)
Remove Favourites association between User and entity
|
void |
removeFavouritesForEntity(SharedEntity entity)
Remove all favourite associations for a given entity.
|
void |
removeFavouritesForUser(ApplicationUser user,
SharedEntity.TypeDescriptor<?> entityType)
Remove the favourite associations for the given User and the given type
|
void |
start()
This method will be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
|
void |
updateSequence(ApplicationUser user,
List<? extends SharedEntity> favouriteEntities)
Called to update the sequence of a list of favourite
shared entities |
public CachingFavouritesStore(FavouritesStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
@EventListener public void onClearCache(ClearCacheEvent event)
public boolean addFavourite(ApplicationUser user, SharedEntity entity)
FavouritesStoreaddFavourite in interface FavouritesStoreuser - User to associate entity withentity - the entity to associate withpublic boolean removeFavourite(ApplicationUser user, SharedEntity entity)
FavouritesStoreremoveFavourite in interface FavouritesStoreuser - to disassociate entity withentity - the entity to disassociate withpublic boolean isFavourite(ApplicationUser user, SharedEntity entity)
FavouritesStoreisFavourite in interface FavouritesStoreuser - to check entity withentity - the entity to check withpublic Collection<Long> getFavouriteIds(ApplicationUser user, SharedEntity.TypeDescriptor<?> entityType)
FavouritesStoregetFavouriteIds in interface FavouritesStoreuser - The user for the associated entitiesentityType - The type of entities to get. E.g. SearchRequest.ENTITY_TYPEpublic Collection<Long> getFavouriteIds(String userKey, SharedEntity.TypeDescriptor<?> entityType)
FavouritesStoregetFavouriteIds in interface FavouritesStoreuserKey - The key of the user for the associated entitiesentityType - The type of entities to get. E.g. SearchRequest.ENTITY_TYPEpublic void removeFavouritesForUser(ApplicationUser user, SharedEntity.TypeDescriptor<?> entityType)
FavouritesStoreremoveFavouritesForUser in interface FavouritesStoreuser - The user with whom to disassociate entities withentityType - The type of entity to disassociate user with.public void removeFavouritesForEntity(SharedEntity entity)
FavouritesStoreremoveFavouritesForEntity in interface FavouritesStoreentity - The entity to remove all associations withpublic void updateSequence(ApplicationUser user, List<? extends SharedEntity> favouriteEntities)
FavouritesStoreshared entitiesupdateSequence in interface FavouritesStoreuser - the user in playfavouriteEntities - the list specifying the order of the SharedEntitysCopyright © 2002-2017 Atlassian. All Rights Reserved.