|
||||||||||
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,
String status)
Retrieve the count of content for a given space with a particular status. |
List |
findAll()
Find all objects currently persisted of a particular type. |
List |
findAllSorted(String s)
Find all objects currently persisted of a particular type and sort results by named property. |
List |
findAllSorted(String s,
boolean cached,
int firstRow,
int maxRows)
Find all objects currently persisted of a particular type and sort results by named property. |
List<AbstractPage> |
findBlogsWithHistoricalTitleInPermittedSpace(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. |
List<ContentEntityObject> |
findContentBySpaceIdAndStatus(long spaceId,
String status,
int offset,
int count)
Retrieve content for a given space with a particular status. |
List |
findHistoricalVersionsAfterVersion(long originalContentId,
int version)
|
long |
findLatestVersionsCount()
Returns the number of results for the latest versions of the current persistent class. |
Iterator |
findLatestVersionsIterator()
Returns an iterator for the latest versions of the current persistent class. |
List<Page> |
findPagesWithHistoricalTitle(String pageTitle)
|
List<AbstractPage> |
findPagesWithHistoricalTitleInAllPermittedSpacesExcept(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. |
List<AbstractPage> |
findPagesWithHistoricalTitleInPermittedSpace(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. |
List |
findPreviousVersions(long originalContentId)
|
Iterator |
getAllCurrentEntities()
|
int |
getAuthoredPagesCountByUser(String username)
|
ContentEntityObject |
getById(long id)
|
int |
getCommentCountOnPage(long id)
Count the number of comments on the passed in page. |
List |
getContentAuthoredByUser(String username)
|
List<Long> |
getDescendentIds(Page page)
|
List<Page> |
getDescendents(Page page)
|
ContentEntityObject |
getFirstVersionAfter(long originalVersionContentId,
int version)
|
ContentEntityObject |
getFirstVersionBefore(long originalVersionContentId,
int version)
|
List<ContentEntityObject> |
getLastEditedVersionsOf(ContentEntityObject content)
Retrieves all the last edited versions for each user who has contributed to the specified piece of content. |
List |
getLockedContentBySpace(String spaceKey)
|
Integer |
getMaxSiblingPosition(Page page)
Gets the highest position value of all the page's siblings. |
String |
getObjectType(long id)
|
List<Page> |
getOrphanedPages(String spaceKey)
|
Page |
getPage(Space space,
String pageTitle)
Get the page by space and title. |
Page |
getPage(String spaceKey,
String pageTitle)
Deprecated. |
Page |
getPage(String spaceKey,
String pageTitle,
boolean eagerLoadComments)
Deprecated. |
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. |
Collection<Long> |
getPageIds(Space space)
Get the ids of all pages (current and historical) in the given space. |
List<Page> |
getPageInTrash(String spaceKey,
String title)
|
List<Page> |
getPages(Space space,
boolean currentOnly)
|
Collection<Page> |
getPagesByIds(Collection<Long> ids)
Get the pages with the given ids. |
List<Page> |
getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
|
List<Page> |
getPagesStartingWith(Space space,
String s)
|
Page |
getPageWithComments(Space space,
String pageTitle)
Get the page by space and title, and perform an eager load of the comments and their children. |
List<Page> |
getPermissionPages(Space space)
|
Class |
getPersistentClass()
|
Iterator |
getRecentlyAddedEntities(String spaceKey,
int maxResults)
|
List<Page> |
getRecentlyAddedPages(int maxCount,
String spaceKey)
|
List<Page> |
getRecentlyAuthoredPagesByUser(String username,
int maxCount)
|
Iterator |
getRecentlyModifiedEntities(int maxResults)
|
Iterator |
getRecentlyModifiedEntities(String spaceKey,
int maxResults)
|
Iterator |
getRecentlyModifiedEntitiesForUser(String username)
|
List |
getRecentlyModifiedForChangeDigest(Date fromDate)
Retrieves a list of ContentEntityObject s that have been newly added or modified
since the date specified. |
List<Page> |
getRecentlyUpdatedPages(int maxCount,
String spaceKey)
|
List<Page> |
getTopLevelPages(Space space)
|
List |
getTrashedContent(String spaceKey)
|
List<Page> |
getUndefinedPages(String spaceKey)
|
ContentEntityObject |
getVersion(long originalVersionContentId,
int version)
|
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 |
removeFromPageKeyCache(String spaceKey,
String pageTitle)
Deprecated. |
void |
replicate(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, String pageTitle)
PageDao
getPage
in interface PageDao
space
- The space the page belongs topageTitle
- The title of the page
public Page getPageWithComments(Space space, String pageTitle)
PageDao
getPageWithComments
in interface PageDao
space
- The space the page belongs topageTitle
- The title of the page
@Deprecated public void removeFromPageKeyCache(String spaceKey, String pageTitle)
removeFromPageKeyCache
in interface PageDao
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 List findAll()
ObjectDao
findAll
in interface ObjectDao
public List findAllSorted(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 List findAllSorted(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 Iterator findLatestVersionsIterator()
VersionedObjectDao
findLatestVersionsIterator
in interface VersionedObjectDao
public List<Page> findPagesWithHistoricalTitle(String pageTitle)
findPagesWithHistoricalTitle
in interface PageDao
public List findPreviousVersions(long originalContentId)
findPreviousVersions
in interface ContentEntityObjectDao
public List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(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 List<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(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 List<AbstractPage> findPagesWithHistoricalTitleInAllPermittedSpacesExcept(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 Iterator getAllCurrentEntities()
getAllCurrentEntities
in interface ContentEntityObjectDao
public int getAuthoredPagesCountByUser(String username)
getAuthoredPagesCountByUser
in interface PageDao
public ContentEntityObject getById(long id)
getById
in interface ContentEntityObjectDao
public List getContentAuthoredByUser(String username)
getContentAuthoredByUser
in interface ContentEntityObjectDao
public List<Long> getDescendentIds(Page page)
getDescendentIds
in interface PageDao
public 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
public List getLockedContentBySpace(String spaceKey)
getLockedContentBySpace
in interface ContentEntityObjectDao
public String getObjectType(long id)
getObjectType
in interface ContentEntityObjectDao
public List<Page> getOrphanedPages(String spaceKey)
getOrphanedPages
in interface PageDao
public Page getPageById(long id)
PageDao
getPageById
in interface PageDao
id
- of the page to load
public Collection<Page> getPagesByIds(Collection<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 List<Page> getPageInTrash(String spaceKey, String title)
getPageInTrash
in interface PageDao
public List<Page> getPages(Space space, boolean currentOnly)
getPages
in interface PageDao
public List<Page> getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
getPagesCreatedOrUpdatedSinceDate
in interface PageDao
public List<Page> getPagesStartingWith(Space space, String s)
getPagesStartingWith
in interface PageDao
public List<Page> getPermissionPages(Space space)
getPermissionPages
in interface PageDao
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
public Iterator getRecentlyAddedEntities(String spaceKey, int maxResults)
getRecentlyAddedEntities
in interface ContentEntityObjectDao
public List<Page> getRecentlyAddedPages(int maxCount, String spaceKey)
getRecentlyAddedPages
in interface PageDao
public List<Page> getRecentlyAuthoredPagesByUser(String username, int maxCount)
getRecentlyAuthoredPagesByUser
in interface PageDao
public Iterator getRecentlyModifiedEntities(int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao
public Iterator getRecentlyModifiedEntities(String spaceKey, int maxResults)
getRecentlyModifiedEntities
in interface ContentEntityObjectDao
public Iterator getRecentlyModifiedEntitiesForUser(String username)
getRecentlyModifiedEntitiesForUser
in interface ContentEntityObjectDao
public List getRecentlyModifiedForChangeDigest(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 List<Page> getRecentlyUpdatedPages(int maxCount, String spaceKey)
getRecentlyUpdatedPages
in interface PageDao
public List<Page> getTopLevelPages(Space space)
getTopLevelPages
in interface PageDao
public Integer getMaxSiblingPosition(Page page)
PageDao
getMaxSiblingPosition
in interface PageDao
page
- The page whose siblings from which to get the max position
public Collection<Long> getPageIds(Space space)
PageDao
getPageIds
in interface PageDao
space
- space to retrieve page ids from, can not be null.
public List getTrashedContent(String spaceKey)
getTrashedContent
in interface ContentEntityObjectDao
public List<Page> getUndefinedPages(String spaceKey)
getUndefinedPages
in interface PageDao
public ContentEntityObject getVersion(long originalVersionContentId, int version)
getVersion
in interface ContentEntityObjectDao
public 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(Object objectToReplicate)
ObjectDao
replicate
in interface ObjectDao
@Deprecated public Page getPage(String spaceKey, String pageTitle, boolean eagerLoadComments)
PageDao
getPage
in interface PageDao
spaceKey
- to match withpageTitle
- to match witheagerLoadComments
- true if comments should be loaded eagerly
@Deprecated public Page getPage(String spaceKey, String pageTitle)
getPage
in interface PageDao
public List<ContentEntityObject> getLastEditedVersionsOf(ContentEntityObject content)
ContentEntityObjectDao
getLastEditedVersionsOf
in interface ContentEntityObjectDao
content
- content (must be the latest version)
public List<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId, 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, 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 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 |