|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.pages.persistence.dao.hibernate.CachingPageDao
public class CachingPageDao
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.
Constructor Summary | |
---|---|
CachingPageDao(PageDao delegateDao,
PageIdCache pageIdCache)
|
Method Summary | |
---|---|
int |
countContentBySpaceIdAndStatus(long spaceId,
java.lang.String status)
Retrieve the count of content for a given space with a particular status. |
java.util.List |
findAll()
Find all objects currently persisted of a particular type. |
java.util.List |
findAllSorted(java.lang.String s)
Find all objects currently persisted of a particular type and sort results by named property. |
java.util.List |
findAllSorted(java.lang.String s,
boolean cached,
int firstRow,
int maxRows)
Find all objects currently persisted of a particular type and sort results by named property. |
java.util.List<AbstractPage> |
findBlogsWithHistoricalTitleInPermittedSpace(java.lang.String blogTitle,
Space space,
int maxResultCount)
Searches for blogs in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results. |
java.util.List<ContentEntityObject> |
findContentBySpaceIdAndStatus(long spaceId,
java.lang.String status,
int offset,
int count)
Retrieve content for a given space with a particular status. |
java.util.List |
findHistoricalVersionsAfterVersion(long originalContentId,
int version)
|
long |
findLatestVersionsCount()
Returns the number of results for the latest versions of the current persistent class. |
java.util.Iterator |
findLatestVersionsIterator()
Returns an iterator for the latest versions of the current persistent class. |
java.util.List<Page> |
findPagesWithHistoricalTitle(java.lang.String pageTitle)
|
java.util.List<AbstractPage> |
findPagesWithHistoricalTitleInAllPermittedSpacesExcept(java.lang.String pageTitle,
Space space,
int maxResultCount)
Searches for pages in all spaces except the one specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results. |
java.util.List<AbstractPage> |
findPagesWithHistoricalTitleInPermittedSpace(java.lang.String pageTitle,
Space space,
int maxResultCount)
Searches for pages in the space specified, looking for those that have the given title in a previous version, and returns the first maxResultCount results. |
java.util.List |
findPreviousVersions(long originalContentId)
|
java.util.Iterator |
getAllCurrentEntities()
|
int |
getAuthoredPagesCountByUser(java.lang.String username)
|
ContentEntityObject |
getById(long id)
|
int |
getCommentCountOnPage(long id)
Count the number of comments on the passed in page. |
java.util.List |
getContentAuthoredByUser(java.lang.String username)
|
java.util.List<java.lang.Long> |
getDescendentIds(Page page)
|
java.util.List<Page> |
getDescendents(Page page)
|
ContentEntityObject |
getFirstVersionAfter(long originalVersionContentId,
int version)
|
ContentEntityObject |
getFirstVersionBefore(long originalVersionContentId,
int version)
|
java.util.List<ContentEntityObject> |
getLastEditedVersionsOf(ContentEntityObject content)
Retrieves all the last edited versions for each user who has contributed to the specified piece of content. |
java.util.List |
getLockedContentBySpace(java.lang.String spaceKey)
Deprecated. since 5.1. There is no replacement as this functionality was superseded by multiple page permissions (CONF-3701) |
java.lang.Integer |
getMaxSiblingPosition(Page page)
Gets the highest position value of all the page's siblings. |
java.lang.String |
getObjectType(long id)
|
java.util.Date |
getOldestPageCreationDate()
Gets the creation date of the oldest page. |
java.util.List<Page> |
getOrphanedPages(java.lang.String spaceKey)
|
Page |
getPage(Space space,
java.lang.String pageTitle)
Get the page by space and title. |
Page |
getPageById(long id)
Get the page with the given id. |
Page |
getPageByIdWithComments(long id)
Get the page with the given id, and perform an eager load of the comments and their children. |
java.util.Collection<java.lang.Long> |
getPageIds(Space space)
Get the ids of all pages (current and historical) in the given space. |
java.util.List<Page> |
getPageInTrash(java.lang.String spaceKey,
java.lang.String title)
|
java.util.List<Page> |
getPages(Space space,
boolean currentOnly)
|
java.util.Collection<Page> |
getPagesByIds(java.util.Collection<java.lang.Long> ids)
Get the pages with the given ids. |
java.util.List<Page> |
getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)
|
java.util.List<Page> |
getPagesStartingWith(Space space,
java.lang.String s)
|
Page |
getPageWithComments(Space space,
java.lang.String pageTitle)
Get the page by space and title, and perform an eager load of the comments and their children. |
java.util.List<Page> |
getPermissionPages(Space space)
|
java.lang.Class |
getPersistentClass()
|
java.util.Iterator |
getRecentlyAddedEntities(java.lang.String spaceKey,
int maxResults)
|
java.util.List<Page> |
getRecentlyAddedPages(int maxCount,
java.lang.String spaceKey)
|
java.util.List<Page> |
getRecentlyAuthoredPagesByUser(java.lang.String username,
int maxCount)
|
java.util.Iterator |
getRecentlyModifiedEntities(int maxResults)
|
java.util.Iterator |
getRecentlyModifiedEntities(java.lang.String spaceKey,
int maxResults)
|
java.util.Iterator |
getRecentlyModifiedEntitiesForUser(java.lang.String username)
|
java.util.List |
getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
Retrieves a list of ContentEntityObject s that have been newly added or modified
since the date specified. |
java.util.List<Page> |
getRecentlyUpdatedPages(int maxCount,
java.lang.String spaceKey)
|
java.util.List<Page> |
getTopLevelPages(Space space)
|
java.util.List |
getTrashedContent(java.lang.String spaceKey)
|
java.util.List<Page> |
getUndefinedPages(java.lang.String spaceKey)
|
ContentEntityObject |
getVersion(long originalVersionContentId,
int version)
|
java.util.List<VersionHistorySummary> |
getVersionHistorySummary(long originalContentId)
|
void |
refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
Refreshes the object again with the fresh data from db. |
void |
remove(com.atlassian.core.bean.EntityObject object)
Remove object from persistence. |
void |
replicate(java.lang.Object objectToReplicate)
Replicate the object. |
void |
save(com.atlassian.core.bean.EntityObject objectToSave)
|
void |
save(com.atlassian.core.bean.EntityObject objectToSave,
com.atlassian.core.bean.EntityObject originalObject)
|
void |
saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
saves the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingPageDao(PageDao delegateDao, PageIdCache pageIdCache)
Method Detail |
---|
public Page getPage(Space space, java.lang.String pageTitle)
PageDao
getPage
in interface PageDao
space
- The space the page belongs topageTitle
- The title of the page
public Page getPageWithComments(Space space, java.lang.String pageTitle)
PageDao
getPageWithComments
in interface PageDao
space
- The space the page belongs topageTitle
- The title of the page
public void remove(com.atlassian.core.bean.EntityObject object)
ObjectDao
remove
in interface ObjectDao
public void save(com.atlassian.core.bean.EntityObject objectToSave, com.atlassian.core.bean.EntityObject originalObject)
save
in interface VersionedObjectDao
public void save(com.atlassian.core.bean.EntityObject objectToSave)
save
in interface ObjectDao
public void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
ObjectDao
saveRaw
in interface ObjectDao
public java.util.List findAll()
ObjectDao
findAll
in interface ObjectDao
public java.util.List findAllSorted(java.lang.String s)
ObjectDao
findAllSorted
in interface ObjectDao
s
- the name of the property to be sorted on. This should be null if no sorting is required.public java.util.List findAllSorted(java.lang.String s, boolean cached, int firstRow, int maxRows)
ObjectDao
findAllSorted
in interface ObjectDao
s
- the name of the property to be sorted on. This should be null if no sorting is required.cached
- control whether the results should be cachedfirstRow
- the index of the first result to be returnedmaxRows
- the maximum number of results required. Use -1 to specify no limit.public long findLatestVersionsCount()
VersionedObjectDao
findLatestVersionsCount
in interface VersionedObjectDao
public java.util.Iterator findLatestVersionsIterator()
VersionedObjectDao
findLatestVersionsIterator
in interface VersionedObjectDao
public java.util.List<Page> findPagesWithHistoricalTitle(java.lang.String pageTitle)
findPagesWithHistoricalTitle
in interface PageDao
public java.util.List findPreviousVersions(long originalContentId)
findPreviousVersions
in interface ContentEntityObjectDao
public java.util.List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(java.lang.String pageTitle, Space space, int maxResultCount)
PageDao
findPagesWithHistoricalTitleInPermittedSpace
in interface PageDao
pageTitle
- title of a page in a previous version.space
- Space to search. Must not be null.maxResultCount
- maximum pages to returnpublic java.util.List<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(java.lang.String blogTitle, Space space, int maxResultCount)
PageDao
findBlogsWithHistoricalTitleInPermittedSpace
in interface PageDao
blogTitle
- title of a page in a previous version.space
- Space to search. Must not be null.maxResultCount
- maximum pages to return
public java.util.List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(java.lang.String pageTitle, Space space, int maxResultCount)
PageDao
findPagesWithHistoricalTitleInAllPermittedSpacesExcept
in interface PageDao
pageTitle
- title of a page in a previous version.space
- Space to exclude from search. If null, all spaces are searched.maxResultCount
- maximum pages to returnpublic java.util.Iterator getAllCurrentEntities()
getAllCurrentEntities
in interface ContentEntityObjectDao
public int getAuthoredPagesCountByUser(java.lang.String username)
getAuthoredPagesCountByUser
in interface PageDao
public ContentEntityObject getById(long id)
getById
in interface ContentEntityObjectDao
public java.util.List getContentAuthoredByUser(java.lang.String username)
getContentAuthoredByUser
in interface ContentEntityObjectDao
public java.util.List<java.lang.Long> getDescendentIds(Page page)
getDescendentIds
in interface PageDao
public java.util.List<Page> getDescendents(Page page)
getDescendents
in interface PageDao
public ContentEntityObject getFirstVersionAfter(long originalVersionContentId, int version)
getFirstVersionAfter
in interface ContentEntityObjectDao
public ContentEntityObject getFirstVersionBefore(long originalVersionContentId, int version)
getFirstVersionBefore
in interface ContentEntityObjectDao
@Deprecated public java.util.List getLockedContentBySpace(java.lang.String spaceKey)
getLockedContentBySpace
in interface ContentEntityObjectDao
public java.lang.String getObjectType(long id)
getObjectType
in interface ContentEntityObjectDao
public java.util.List<Page> getOrphanedPages(java.lang.String spaceKey)
getOrphanedPages
in interface PageDao
public Page getPageById(long id)
PageDao
getPageById
in interface PageDao
id
- of the page to load
public java.util.Collection<Page> getPagesByIds(java.util.Collection<java.lang.Long> ids)
getPagesByIds
in interface PageDao
public Page getPageByIdWithComments(long id)
PageDao
getPageByIdWithComments
in interface PageDao
id
- of the page to load
public int getCommentCountOnPage(long id)
PageDao
getCommentCountOnPage
in interface PageDao
public java.util.List<Page> getPageInTrash(java.lang.String spaceKey, java.lang.String title)
getPageInTrash
in interface PageDao
public java.util.List<Page> getPages(Space space, boolean currentOnly)
getPages
in interface PageDao
public java.util.List<Page> getPagesCreatedOrUpdatedSinceDate(java.util.Date previousLoginDate)
getPagesCreatedOrUpdatedSinceDate
in interface PageDao
public java.util.List<Page> getPagesStartingWith(Space space, java.lang.String s)
getPagesStartingWith
in interface PageDao
public java.util.List<Page> getPermissionPages(Space space)
getPermissionPages
in interface PageDao
public java.lang.Class getPersistentClass()
getPersistentClass
in interface ObjectDao
public java.util.Iterator getRecentlyAddedEntities(java.lang.String spaceKey, int maxResults)
getRecentlyAddedEntities
in interface ContentEntityObjectDao
public java.util.List<Page> getRecentlyAddedPages(int maxCount, java.lang.String spaceKey)
getRecentlyAddedPages
in interface PageDao
public java.util.List<Page> getRecentlyAuthoredPagesByUser(java.lang.String username, int maxCount)
getRecentlyAuthoredPagesByUser
in interface PageDao
public java.util.Iterator getRecentlyModifiedEntities(int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao
public java.util.Iterator getRecentlyModifiedEntities(java.lang.String spaceKey, int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao
public java.util.Iterator getRecentlyModifiedEntitiesForUser(java.lang.String username)
getRecentlyModifiedEntitiesForUser
in interface ContentEntityObjectDao
public java.util.List getRecentlyModifiedForChangeDigest(java.util.Date fromDate)
ContentEntityObjectDao
ContentEntityObject
s that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.
getRecentlyModifiedForChangeDigest
in interface ContentEntityObjectDao
fromDate
- content modified after this date will be returned
ContentEntityObject
s that have been newly added or modified
since the date specifiedpublic java.util.List<Page> getRecentlyUpdatedPages(int maxCount, java.lang.String spaceKey)
getRecentlyUpdatedPages
in interface PageDao
public java.util.List<Page> getTopLevelPages(Space space)
getTopLevelPages
in interface PageDao
public java.lang.Integer getMaxSiblingPosition(Page page)
PageDao
getMaxSiblingPosition
in interface PageDao
page
- The page whose siblings from which to get the max position
public java.util.Collection<java.lang.Long> getPageIds(Space space)
PageDao
getPageIds
in interface PageDao
space
- space to retrieve page ids from, can not be null.
public java.util.Date getOldestPageCreationDate()
ContentEntityObjectDao
getOldestPageCreationDate
in interface ContentEntityObjectDao
public java.util.List getTrashedContent(java.lang.String spaceKey)
getTrashedContent
in interface ContentEntityObjectDao
public java.util.List<Page> getUndefinedPages(java.lang.String spaceKey)
getUndefinedPages
in interface PageDao
public ContentEntityObject getVersion(long originalVersionContentId, int version)
getVersion
in interface ContentEntityObjectDao
public java.util.List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
getVersionHistorySummary
in interface ContentEntityObjectDao
public void refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
ObjectDao
refresh
in interface ObjectDao
public void replicate(java.lang.Object objectToReplicate)
ObjectDao
replicate
in interface ObjectDao
public java.util.List<ContentEntityObject> getLastEditedVersionsOf(ContentEntityObject content)
ContentEntityObjectDao
getLastEditedVersionsOf
in interface ContentEntityObjectDao
content
- content (must be the latest version)
public java.util.List<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, java.lang.String status, int offset, int count)
ContentEntityObjectDao
findContentBySpaceIdAndStatus
in interface ContentEntityObjectDao
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
offset
- the offset of the first item to retrieve (0-based)count
- the maximum number of items to retrieve
public int countContentBySpaceIdAndStatus(long spaceId, java.lang.String status)
ContentEntityObjectDao
countContentBySpaceIdAndStatus
in interface ContentEntityObjectDao
spaceId
- the id of the spacestatus
- the status of the content being retrieved (e.g. ContentEntityObject.DELETED
public java.util.List findHistoricalVersionsAfterVersion(long originalContentId, int version)
findHistoricalVersionsAfterVersion
in interface ContentEntityObjectDao
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |