Package com.atlassian.jira.favourites
Class CachingFavouritesStore
java.lang.Object
com.atlassian.jira.favourites.CachingFavouritesStore
- All Implemented Interfaces:
Startable
,FavouritesStore
,InitializingComponent
public class CachingFavouritesStore
extends Object
implements FavouritesStore, Startable, InitializingComponent
Cache is keyed on userkey:type. This is very broken, but no more broken than any
of the other caches.
- Since:
- v3.13
-
Constructor Summary
ConstructorsConstructorDescriptionCachingFavouritesStore
(FavouritesStore delegateStore, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addFavourite
(ApplicationUser user, SharedEntity entity) Create Favourites association between User and entityvoid
Called after all the beans are constructed and the ApplicationContext is fully populated.getFavouriteIds
(ApplicationUser user, SharedEntity.TypeDescriptor<?> entityType) Get the ids of a user's favourite Entities for a given entity typegetFavouriteIds
(String userKey, SharedEntity.TypeDescriptor<?> entityType) Get the ids of a user's favourite Entities for a given entity typeboolean
isFavourite
(ApplicationUser user, SharedEntity entity) Checks to see if entity is a favourite of the user passed in.void
onClearCache
(ClearCacheEvent event) void
boolean
removeFavourite
(ApplicationUser user, SharedEntity entity) Remove Favourites association between User and entityvoid
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 typevoid
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 favouriteshared entities
-
Constructor Details
-
CachingFavouritesStore
public CachingFavouritesStore(FavouritesStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponent
Called after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiation
in interfaceInitializingComponent
- Throws:
Exception
-
onClearCache
-
onFavouriteAssociationsFKChangedEvent
@EventListener public void onFavouriteAssociationsFKChangedEvent(FavouriteAssociationsFKChangedEvent event) -
updateSequence
Description copied from interface:FavouritesStore
Called to update the sequence of a list of favouriteshared entities
- Specified by:
updateSequence
in interfaceFavouritesStore
- Parameters:
user
- the user in playfavouriteEntities
- the list specifying the order of theSharedEntity
s
-
start
Description copied from interface:Startable
This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-