|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.favourites.CachingFavouritesStore
public class CachingFavouritesStore
Cache is keyed on username:type. This is very broken, but no more broken than any of the other caches.
Constructor Summary | |
---|---|
CachingFavouritesStore(FavouritesStore delegateStore,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
boolean |
addFavourite(String username,
SharedEntity entity)
Create Favourites association between User and entity |
boolean |
addFavourite(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Create Favourites association between User and entity |
Collection<Long> |
getFavouriteIds(com.atlassian.crowd.embedded.api.User user,
SharedEntity.TypeDescriptor<?> entityType)
Get the ids of a user's favourite Entities for a given entity type |
boolean |
isFavourite(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Checks to see if entity is a favourite of the user passed in. |
void |
onClearCache(ClearCacheEvent event)
|
boolean |
removeFavourite(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Remove Favourites association between User and entity |
void |
removeFavouritesForEntity(SharedEntity entity)
Remove all favourite associations for a given entity. |
void |
removeFavouritesForUser(com.atlassian.crowd.embedded.api.User user,
SharedEntity.TypeDescriptor<?> entityType)
Remove the favourite associations for the given User and the given type |
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
void |
updateSequence(com.atlassian.crowd.embedded.api.User user,
List<? extends SharedEntity> favouriteEntities)
Called to update the sequence of a list of favourite shared entities |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingFavouritesStore(FavouritesStore delegateStore, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
public void start() throws Exception
Startable
start
in interface Startable
Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public boolean addFavourite(com.atlassian.crowd.embedded.api.User user, SharedEntity entity)
FavouritesStore
addFavourite
in interface FavouritesStore
user
- User to associate entity withentity
- the entity to associate with
public boolean addFavourite(String username, SharedEntity entity)
FavouritesStore
addFavourite
in interface FavouritesStore
username
- user to associate entity withentity
- the entity to associate with
public boolean removeFavourite(com.atlassian.crowd.embedded.api.User user, SharedEntity entity)
FavouritesStore
removeFavourite
in interface FavouritesStore
user
- to disassociate entity withentity
- the entity to disassociate with
public boolean isFavourite(com.atlassian.crowd.embedded.api.User user, SharedEntity entity)
FavouritesStore
isFavourite
in interface FavouritesStore
user
- to check entity withentity
- the entity to check with
public Collection<Long> getFavouriteIds(com.atlassian.crowd.embedded.api.User user, SharedEntity.TypeDescriptor<?> entityType)
FavouritesStore
getFavouriteIds
in interface FavouritesStore
user
- The user for the associated entitiesentityType
- The type of entities to get. E.g. SearchRequest.ENTITY_TYPE
public void removeFavouritesForUser(com.atlassian.crowd.embedded.api.User user, SharedEntity.TypeDescriptor<?> entityType)
FavouritesStore
removeFavouritesForUser
in interface FavouritesStore
user
- The user with whom to disassociate entities withentityType
- The type of entity to disassociate user with.public void removeFavouritesForEntity(SharedEntity entity)
FavouritesStore
removeFavouritesForEntity
in interface FavouritesStore
entity
- The entity to remove all associations withpublic void updateSequence(com.atlassian.crowd.embedded.api.User user, List<? extends SharedEntity> favouriteEntities)
FavouritesStore
shared entities
updateSequence
in interface FavouritesStore
user
- the user in playfavouriteEntities
- the list specifying the order of the SharedEntity
s
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |