Package com.atlassian.jira.portal
Class CachingPortalPageStore
java.lang.Object
com.atlassian.jira.portal.CachingPortalPageStore
- All Implemented Interfaces:
InitializingComponent,PortalPageStore
public class CachingPortalPageStore
extends Object
implements PortalPageStore, InitializingComponent
Caching store for
PortalPage. The cache stores a id -> PortalPage and a
portalPage.owner -> id mapping.- Since:
- v3.13
-
Constructor Summary
ConstructorsConstructorDescriptionCachingPortalPageStore(PortalPageStore delegateStore, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionadjustFavouriteCount(SharedEntity portalPage, int incrementValue) Updates the favourite count of the PortalPage in the database.voidCalled after all the beans are constructed and the ApplicationContext is fully populated.create(PortalPage portalPage) Creates a PortalPage in the databasevoidDeletes the PortalPage with the specified portalPageIdvoidflush()Flushes any caches that may existGet aEnclosedIterableof PortalPages for the specified List of ids.getAll()Get aEnclosedIterableof all PortalPages in the database.Gets all the PortalPage's owned by the specified UsergetAllOwnedPortalPages(String userKey) Gets all the PortalPage's owned by the specified UsergetPortalPage(Long portalPageId) Gets the PortalPage with the specified portalPageIdgetPortalPageByOwnerAndName(ApplicationUser owner, String portalPageName) Gets the specified PortalPage that is owned by the User and has the specified portalPageNameGoes to the database and fetches the system default dashboard configuration.voidonClearCache(ClearCacheEvent event) voidupdate(PortalPage portalPage) Updates the PortalPage in the database.booleanupdatePortalPageOptimisticLock(Long portalPageId, Long currentVersion) This method will increment the version of the given portalPage by one.
-
Constructor Details
-
CachingPortalPageStore
public CachingPortalPageStore(PortalPageStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled 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:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
onUserKeyInPortalPageFKChangedEvent
@EventListener public void onUserKeyInPortalPageFKChangedEvent(UserKeyInPortalPageFKChangedEvent event) -
getAll
Description copied from interface:PortalPageStoreGet aEnclosedIterableof all PortalPages in the database.- Specified by:
getAllin interfacePortalPageStore- Returns:
- CloseableIterable that contains reference to all PortalPages.
-
getSystemDefaultPortalPage
Description copied from interface:PortalPageStoreGoes to the database and fetches the system default dashboard configuration.- Specified by:
getSystemDefaultPortalPagein interfacePortalPageStore- Returns:
- the system default portal page.
-
getAllOwnedPortalPages
Description copied from interface:PortalPageStoreGets all the PortalPage's owned by the specified User- Specified by:
getAllOwnedPortalPagesin interfacePortalPageStore- Parameters:
owner- the user who is the owner of the PortalPage's- Returns:
- a Collection of PortalPage objects owner by the User
-
getAllOwnedPortalPages
Description copied from interface:PortalPageStoreGets all the PortalPage's owned by the specified User- Specified by:
getAllOwnedPortalPagesin interfacePortalPageStore- Parameters:
userKey- The key of the user who is the owner of the PortalPage's- Returns:
- a Collection of PortalPage objects owner by the User
-
getPortalPageByOwnerAndName
Description copied from interface:PortalPageStoreGets the specified PortalPage that is owned by the User and has the specified portalPageName- Specified by:
getPortalPageByOwnerAndNamein interfacePortalPageStore- Parameters:
owner- the User how is the owner of the PortalPageportalPageName- the name of the PortalPage- Returns:
- a PortalPage object or null if it cant be found
-
getPortalPage
Description copied from interface:PortalPageStoreGets the PortalPage with the specified portalPageId- Specified by:
getPortalPagein interfacePortalPageStore- Parameters:
portalPageId- the id of the PortalPage to locate- Returns:
- a PortalPage or null if it cant be found
-
create
Description copied from interface:PortalPageStoreCreates a PortalPage in the database- Specified by:
createin interfacePortalPageStore- Parameters:
portalPage- the PortalPage to create- Returns:
- the new PortalPage with its new database id
-
update
Description copied from interface:PortalPageStoreUpdates the PortalPage in the database.- Specified by:
updatein interfacePortalPageStore- Parameters:
portalPage- the PortalPage to update- Returns:
- a newly updated PortalPage object
-
updatePortalPageOptimisticLock
Description copied from interface:PortalPageStoreThis method will increment the version of the given portalPage by one. When doing this, it will check that the version currently equals what was passed in. If the update is successful, this method returns true. False otherwiseIn 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.
- Specified by:
updatePortalPageOptimisticLockin interfacePortalPageStore- Parameters:
portalPageId- The dashboard to updatecurrentVersion- The current version for this dashboard- Returns:
- true if the update is successful, false otherwise
-
delete
Description copied from interface:PortalPageStoreDeletes the PortalPage with the specified portalPageId- Specified by:
deletein interfacePortalPageStore- Parameters:
portalPageId- the id of the PortalPage to delete
-
flush
public void flush()Description copied from interface:PortalPageStoreFlushes any caches that may exist- Specified by:
flushin interfacePortalPageStore
-