public class CachingPortalPageStore extends Object implements PortalPageStore
PortalPage. The cache stores a id -> PortalPage and a
portalPage.owner -> id mapping.| Constructor and Description |
|---|
CachingPortalPageStore(PortalPageStore delegateStore,
com.atlassian.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
PortalPage |
adjustFavouriteCount(SharedEntity portalPage,
int incrementValue)
Updates the favourite count of the PortalPage in the database.
|
PortalPage |
create(PortalPage portalPage)
Creates a PortalPage in the database
|
void |
delete(Long portalPageId)
Deletes the PortalPage with the specified portalPageId
|
void |
flush()
Flushes any caches that may exist
|
EnclosedIterable<PortalPage> |
get(SharedEntityAccessor.RetrievalDescriptor ids)
Get a
EnclosedIterable of PortalPages for the specified List of ids. |
EnclosedIterable<PortalPage> |
getAll()
Get a
EnclosedIterable of all PortalPages in the database. |
Collection<PortalPage> |
getAllOwnedPortalPages(ApplicationUser owner)
Gets all the PortalPage's owned by the specified User
|
Collection<PortalPage> |
getAllOwnedPortalPages(String userKey)
Gets all the PortalPage's owned by the specified User
|
PortalPage |
getPortalPage(Long portalPageId)
Gets the PortalPage with the specified portalPageId
|
PortalPage |
getPortalPageByOwnerAndName(ApplicationUser owner,
String portalPageName)
Gets the specified PortalPage that is owned by the User and has the specified portalPageName
|
PortalPage |
getSystemDefaultPortalPage()
Goes to the database and fetches the system default dashboard configuration.
|
void |
onClearCache(ClearCacheEvent event) |
void |
onUserKeyInPortalPageFKChangedEvent(UserKeyInPortalPageFKChangedEvent event) |
PortalPage |
update(PortalPage portalPage)
Updates the PortalPage in the database.
|
boolean |
updatePortalPageOptimisticLock(Long portalPageId,
Long currentVersion)
This method will increment the version of the given portalPage by one.
|
public CachingPortalPageStore(PortalPageStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
@EventListener public void onClearCache(ClearCacheEvent event)
@EventListener public void onUserKeyInPortalPageFKChangedEvent(UserKeyInPortalPageFKChangedEvent event)
public EnclosedIterable<PortalPage> get(SharedEntityAccessor.RetrievalDescriptor ids)
PortalPageStoreEnclosedIterable of PortalPages for the specified List of ids.get in interface PortalPageStoreids - retrieval descriptorpublic EnclosedIterable<PortalPage> getAll()
PortalPageStoreEnclosedIterable of all PortalPages in the database.getAll in interface PortalPageStorepublic PortalPage getSystemDefaultPortalPage()
PortalPageStoregetSystemDefaultPortalPage in interface PortalPageStorepublic Collection<PortalPage> getAllOwnedPortalPages(@Nonnull ApplicationUser owner)
PortalPageStoregetAllOwnedPortalPages in interface PortalPageStoreowner - the user who is the owner of the PortalPage'spublic Collection<PortalPage> getAllOwnedPortalPages(@Nonnull String userKey)
PortalPageStoregetAllOwnedPortalPages in interface PortalPageStoreuserKey - The key of the user who is the owner of the PortalPage'spublic PortalPage getPortalPageByOwnerAndName(ApplicationUser owner, String portalPageName)
PortalPageStoregetPortalPageByOwnerAndName in interface PortalPageStoreowner - the User how is the owner of the PortalPageportalPageName - the name of the PortalPagepublic PortalPage getPortalPage(Long portalPageId)
PortalPageStoregetPortalPage in interface PortalPageStoreportalPageId - the id of the PortalPage to locatepublic PortalPage create(PortalPage portalPage)
PortalPageStorecreate in interface PortalPageStoreportalPage - the PortalPage to createpublic PortalPage update(PortalPage portalPage)
PortalPageStoreupdate in interface PortalPageStoreportalPage - the PortalPage to updatepublic boolean updatePortalPageOptimisticLock(Long portalPageId, Long currentVersion)
PortalPageStoreIn JIRA since we don't have transactions, this method should be called inside a pessimistic lock (potentially striped by portalPageId) and all update operations should follow while holding this same lock.
updatePortalPageOptimisticLock in interface PortalPageStoreportalPageId - The dashboard to updatecurrentVersion - The current version for this dashboardpublic PortalPage adjustFavouriteCount(SharedEntity portalPage, int incrementValue)
PortalPageStoreadjustFavouriteCount in interface PortalPageStoreportalPage - the portal page to change.incrementValue - the value to increase the favourite count by. Can be a number < 0 to decrease the favourite count.public void delete(Long portalPageId)
PortalPageStoredelete in interface PortalPageStoreportalPageId - the id of the PortalPage to deletepublic void flush()
PortalPageStoreflush in interface PortalPageStoreCopyright © 2002-2023 Atlassian. All Rights Reserved.