Class ReadThroughCachingPageDao
- java.lang.Object
-
- com.atlassian.confluence.pages.persistence.dao.DelegatingPageDao
-
- com.atlassian.confluence.impl.pages.persistence.dao.ReadThroughCachingPageDao
-
- All Implemented Interfaces:
ObjectDao
,ContentEntityObjectDao<Page>
,VersionedObjectDao<Page>
,PageDaoInternal
,ContentEntityObjectDaoInternal<Page>
,ObjectDaoInternal<Page>
,VersionedObjectDaoInternal<Page>
,PageDao
public class ReadThroughCachingPageDao extends DelegatingPageDao
This maintains a cache of (space key, page title) -> (page id) mappings. All page ids cached refer to current pages. When a page is marked for deletion, it is removed from this cache.- Since:
- 7.5
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReadThroughCachingPageDao
create(PageDaoInternal delegateDao, com.atlassian.cache.CacheFactory cacheFactory)
Page
getPage(Space space, String pageTitle)
Get the page by space and title.Page
getPageWithComments(Space space, String pageTitle)
Get the page by space and title, and perform an eager load of the comments and their children.void
remove(com.atlassian.core.bean.EntityObject object)
Remove object from persistence.void
removeEntity(Page objectToRemove)
Remove object from persistence.void
save(com.atlassian.core.bean.EntityObject objectToSave)
void
save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject originalObject)
Saves the given current object and historical objectvoid
saveEntity(Page objectToSave)
Saves the given object to the database.void
saveEntity(Page currentObject, @Nullable Page originalObject)
Saves the given current object and historical object.void
saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
saves the object.void
saveRawEntity(Page objectToSave)
Saves the object without updating modification daa.-
Methods inherited from class com.atlassian.confluence.pages.persistence.dao.DelegatingPageDao
countAllPages, countContentBySpaceIdAndStatus, countCurrentPages, countDraftPages, countPagesInSubtree, countPagesWithUnpublishedChanges, findAll, findAllDraftsFor, findAllLegacyDraftsFor, findAllSorted, findAllSorted, findBlogsWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept, findBlogsWithCurrentOrHistoricalTitleInPermittedSpace, findByClassIds, findByClassIdsFiltered, findContentBySpaceIdAndStatus, findContentBySpaceIdAndStatus, findContentPermissionSummaryByIds, findCurrentPages, findDraftFor, findDraftsWithUnpublishedChangesForUser, findHistoricalVersionsAfterVersion, findLatestVersionsCount, findLatestVersionsIterator, findPagesWithCurrentOrHistoricalTitleInAllPermittedSpacesExcept, findPagesWithCurrentOrHistoricalTitleInPermittedSpace, findPreviousVersions, findUnpublishedContentWithUserContributions, getAbstractPages, getAbstractPages, getAbstractPages, getAbstractPages, getAbstractPages, getAbstractPagesByCreationDate, getAbstractPagesByTitle, getAllChildren, getAllCurrentEntities, getAllModifiers, getAllModifiers, getAncestorsFor, getAuthoredPagesCountByUser, getBlogPosts, getById, getChildren, getCommentCountOnPage, getContentAuthoredByUser, getContributionStatusByUser, getDelegateDao, getDescendantIds, getDescendantIds, getDescendants, getDescendantTitles, getDraftChildren, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getMaxSiblingPosition, getObjectType, getOldestPageCreationDate, getOrphanedPages, getPageAndBlogPostsVersionsLastEditedByUser, getPageAndBlogPostsVersionsLastEditedByUserIncludingDrafts, getPageById, getPageByIdWithComments, getPageCount, getPageCount, getPageIds, getPageInTrash, getPages, getPages, getPages, getPagesByIds, getPagesCreatedOrUpdatedSinceDate, getPagesStartingWith, getPageStatistics, getPagesWithPermissions, getPermissionPages, getPermissionPages, getPermissionPagesCount, getPersistentClass, getRecentlyAddedEntities, getRecentlyAddedPages, getRecentlyAuthoredPagesByUser, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getRecentlyUpdatedPages, getTopLevelPages, getTopLevelPages, getTrashedContent, getTrashedContents, getTrashedEntities, getUndefinedLinks, getUndefinedPages, getVersion, getVersionEditContributors, getVersionHistorySummary, getVersionHistorySummary, getVersionsLastEditedByUser, getVersionsLastEditedByUserNew, refresh, refreshEntity, replicate, replicateEntity, saveRawWithoutReindex, scanFilteredPages, scanFilteredPages
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.core.persistence.ContentEntityObjectDao
getTrashedContents
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ContentEntityObjectDaoInternal
findContentBySpaceIdAndStatusAndFilter
-
Methods inherited from interface com.atlassian.confluence.internal.pages.persistence.PageDaoInternal
getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPages, getFilteredAbstractPagesByCreationDate, getFilteredAbstractPagesByTitle, getFilteredBlogPosts, getFilteredChildren, getFilteredPages, getFilteredPages, getFilteredTopLevelPages
-
-
-
-
Method Detail
-
create
public static ReadThroughCachingPageDao create(PageDaoInternal delegateDao, com.atlassian.cache.CacheFactory cacheFactory)
-
getPage
public Page getPage(Space space, String pageTitle)
Description copied from interface:PageDao
Get the page by space and title.- Specified by:
getPage
in interfacePageDao
- Overrides:
getPage
in classDelegatingPageDao
- Parameters:
space
- The space the page belongs topageTitle
- The title of the page- Returns:
- the page with the given title in the given space, or null if no such page exists
-
getPageWithComments
public Page getPageWithComments(Space space, String pageTitle)
Description copied from interface:PageDao
Get the page by space and title, and perform an eager load of the comments and their children. This can be used as a performance optimisation when it is known that all comments will be displayed.- Specified by:
getPageWithComments
in interfacePageDao
- Overrides:
getPageWithComments
in classDelegatingPageDao
- Parameters:
space
- The space the page belongs topageTitle
- The title of the page- Returns:
- the page with the given title in the given space, or null if no such page exists
-
remove
public void remove(com.atlassian.core.bean.EntityObject object)
Description copied from interface:ObjectDao
Remove object from persistence.- Specified by:
remove
in interfaceObjectDao
- Specified by:
remove
in interfaceObjectDaoInternal<Page>
- Overrides:
remove
in classDelegatingPageDao
-
removeEntity
public void removeEntity(Page objectToRemove)
Description copied from interface:ObjectDaoInternal
Remove object from persistence.- Specified by:
removeEntity
in interfaceObjectDaoInternal<Page>
- Overrides:
removeEntity
in classDelegatingPageDao
-
save
public void save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject originalObject)
Description copied from interface:VersionedObjectDao
Saves the given current object and historical object- Specified by:
save
in interfaceVersionedObjectDao<Page>
- Overrides:
save
in classDelegatingPageDao
- Parameters:
objectToSave
- the current object.originalObject
- the original object. This will be mutated to become a historical version as part of this save.
-
saveEntity
public void saveEntity(Page currentObject, @Nullable Page originalObject)
Description copied from interface:VersionedObjectDaoInternal
Saves the given current object and historical object.- Specified by:
saveEntity
in interfaceVersionedObjectDaoInternal<Page>
- Overrides:
saveEntity
in classDelegatingPageDao
- Parameters:
currentObject
- the current object.originalObject
- the original object. This will be mutated to become a historical version as part of this save.
-
save
public void save(com.atlassian.core.bean.EntityObject objectToSave)
- Specified by:
save
in interfaceObjectDao
- Specified by:
save
in interfaceObjectDaoInternal<Page>
- Overrides:
save
in classDelegatingPageDao
-
saveEntity
public void saveEntity(Page objectToSave)
Description copied from interface:ObjectDaoInternal
Saves the given object to the database.- Specified by:
saveEntity
in interfaceObjectDaoInternal<Page>
- Overrides:
saveEntity
in classDelegatingPageDao
- Parameters:
objectToSave
- the object to save.
-
saveRaw
public void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
Description copied from interface:ObjectDao
saves the object. if the object is new, this won't set the creation date on the object. if it already exists, then it won't set the date that it was updated.- Specified by:
saveRaw
in interfaceObjectDao
- Specified by:
saveRaw
in interfaceObjectDaoInternal<Page>
- Overrides:
saveRaw
in classDelegatingPageDao
- Parameters:
objectToSave
- the object to save.
-
saveRawEntity
public void saveRawEntity(Page objectToSave)
Description copied from interface:ObjectDaoInternal
Saves the object without updating modification daa.If the object is new, this won't set the creation date on the object. If it already exists, then it won't set the date that it was updated.
- Specified by:
saveRawEntity
in interfaceObjectDaoInternal<Page>
- Overrides:
saveRawEntity
in classDelegatingPageDao
- Parameters:
objectToSave
- the object to save.
-
-