|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.favourites.DefaultFavouritesManager
public class DefaultFavouritesManager
Constructor Summary | |
---|---|
DefaultFavouritesManager(FavouritesStore store,
SharedEntityAccessor.Factory sharedEntityAccessorFactory,
ShareManager shareManager)
|
Method Summary | |
---|---|
void |
addFavourite(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Add the given entity as a favourite of the user passed in add to favourites count if necessary. |
void |
addFavouriteInPosition(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity,
long position)
Add the given entity as a favourite of the user passed in, in the specified position, add to favourites count if necessary. |
void |
decreaseFavouriteSequence(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Decreases the position of the SharedEntity relative to the user's set of all other entities of the same type. |
Collection<Long> |
getFavouriteIds(com.atlassian.crowd.embedded.api.User user,
SharedEntity.TypeDescriptor<SharedEntity> entityType)
Get the ids of a user's favourite Entities for a given entity type |
void |
increaseFavouriteSequence(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Increases the position of the SharedEntity relative to the user's set of all other entities of the same type. |
boolean |
isFavourite(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Check to see if the given entity is a favourite of the user passed in. |
void |
moveToEndFavouriteSequence(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Moves the position of the SharedEntity to the end relative to the user's set of all other entities of the same type. |
void |
moveToStartFavouriteSequence(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Moves the position of the SharedEntity to the start relative to the user's set of all other entities of the same type. |
void |
removeFavourite(com.atlassian.crowd.embedded.api.User user,
SharedEntity entity)
Remove the given entity as a favourite of the user passed in. |
void |
removeFavouritesForEntityDelete(SharedEntity entity)
Remove all favourite associations for a given entity for entity deletion. |
void |
removeFavouritesForUser(com.atlassian.crowd.embedded.api.User user,
SharedEntity.TypeDescriptor<SharedEntity> entityType)
Remove the favourite associations for the given User and the given type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFavouritesManager(FavouritesStore store, SharedEntityAccessor.Factory sharedEntityAccessorFactory, ShareManager shareManager)
Method Detail |
---|
public void addFavourite(com.atlassian.crowd.embedded.api.User user, SharedEntity entity) throws PermissionException
FavouritesManager
addFavourite
in interface FavouritesManager<SharedEntity>
user
- The user adding the favouriteentity
- The entity to favourite
PermissionException
- when trying to add a filter as favourite when you have no permissionspublic void addFavouriteInPosition(com.atlassian.crowd.embedded.api.User user, SharedEntity entity, long position) throws PermissionException
FavouritesManager
addFavouriteInPosition
in interface FavouritesManager<SharedEntity>
user
- The user adding the favouriteentity
- The entity to favouriteposition
- the position in which this entity should be added in the favourites order.
PermissionException
- when trying to add a filter as favourite when you have no permissionspublic void removeFavourite(com.atlassian.crowd.embedded.api.User user, SharedEntity entity)
FavouritesManager
removeFavourite
in interface FavouritesManager<SharedEntity>
user
- The user removing the favouriteentity
- The entity to favouritepublic boolean isFavourite(com.atlassian.crowd.embedded.api.User user, SharedEntity entity) throws PermissionException
FavouritesManager
isFavourite
in interface FavouritesManager<SharedEntity>
user
- The user checking the favouriteentity
- The entity to favourite
PermissionException
- when checking a filter with no permissionpublic Collection<Long> getFavouriteIds(com.atlassian.crowd.embedded.api.User user, SharedEntity.TypeDescriptor<SharedEntity> entityType)
FavouritesManager
getFavouriteIds
in interface FavouritesManager<SharedEntity>
user
- The user for the associated entities. Can not be null.entityType
- The type of entities to get. E.g. SearchRequest.ENTITY_TYPE. Can not be null.
public void removeFavouritesForUser(com.atlassian.crowd.embedded.api.User user, SharedEntity.TypeDescriptor<SharedEntity> entityType)
FavouritesManager
removeFavouritesForUser
in interface FavouritesManager<SharedEntity>
user
- The user with whom to disassociate entities withentityType
- The type of entity to disassociate user with.public void removeFavouritesForEntityDelete(SharedEntity entity)
FavouritesManager
removeFavouritesForEntityDelete
in interface FavouritesManager<SharedEntity>
entity
- The entity that is being deletedpublic void increaseFavouriteSequence(com.atlassian.crowd.embedded.api.User user, SharedEntity entity) throws PermissionException
FavouritesManager
SharedEntity
relative to the user's set of all other entities of the same type.
increaseFavouriteSequence
in interface FavouritesManager<SharedEntity>
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.public void decreaseFavouriteSequence(com.atlassian.crowd.embedded.api.User user, SharedEntity entity) throws PermissionException
FavouritesManager
SharedEntity
relative to the user's set of all other entities of the same type.
decreaseFavouriteSequence
in interface FavouritesManager<SharedEntity>
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.public void moveToStartFavouriteSequence(com.atlassian.crowd.embedded.api.User user, SharedEntity entity) throws PermissionException
FavouritesManager
SharedEntity
to the start relative to the user's set of all other entities of the same type.
moveToStartFavouriteSequence
in interface FavouritesManager<SharedEntity>
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.public void moveToEndFavouriteSequence(com.atlassian.crowd.embedded.api.User user, SharedEntity entity) throws PermissionException
FavouritesManager
SharedEntity
to the end relative to the user's set of all other entities of the same type.
moveToEndFavouriteSequence
in interface FavouritesManager<SharedEntity>
user
- the user whom the entity belongs toentity
- The entity in question
PermissionException
- when the user does not have permission to perform the action.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |