|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 ContentEntityObjects 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 PageDaospace - The space the page belongs topageTitle - The title of the page
public Page getPageWithComments(Space space,
String pageTitle)
PageDao
getPageWithComments in interface PageDaospace - The space the page belongs topageTitle - The title of the page
@Deprecated
public void removeFromPageKeyCache(String spaceKey,
String pageTitle)
removeFromPageKeyCache in interface PageDaopublic 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 VersionedObjectDaopublic void save(com.atlassian.core.bean.EntityObject objectToSave)
save in interface ObjectDaopublic void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
ObjectDao
saveRaw in interface ObjectDaopublic List findAll()
ObjectDao
findAll in interface ObjectDaopublic List findAllSorted(String s)
ObjectDao
findAllSorted in interface ObjectDaos - 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 ObjectDaos - 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 VersionedObjectDaopublic Iterator findLatestVersionsIterator()
VersionedObjectDao
findLatestVersionsIterator in interface VersionedObjectDaopublic List<Page> findPagesWithHistoricalTitle(String pageTitle)
findPagesWithHistoricalTitle in interface PageDaopublic List findPreviousVersions(long originalContentId)
findPreviousVersions in interface ContentEntityObjectDao
public List<AbstractPage> findPagesWithHistoricalTitleInPermittedSpace(String pageTitle,
Space space,
int maxResultCount)
PageDao
findPagesWithHistoricalTitleInPermittedSpace in interface PageDaopageTitle - title of a page in a previous version.space - Space to search. Must not be null.maxResultCount - maximum pages to return
public List<AbstractPage> findBlogsWithHistoricalTitleInPermittedSpace(String blogTitle,
Space space,
int maxResultCount)
PageDao
findBlogsWithHistoricalTitleInPermittedSpace in interface PageDaoblogTitle - 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 PageDaopageTitle - 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 ContentEntityObjectDaopublic int getAuthoredPagesCountByUser(String username)
getAuthoredPagesCountByUser in interface PageDaopublic ContentEntityObject getById(long id)
getById in interface ContentEntityObjectDaopublic List getContentAuthoredByUser(String username)
getContentAuthoredByUser in interface ContentEntityObjectDaopublic List<Long> getDescendentIds(Page page)
getDescendentIds in interface PageDaopublic 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 ContentEntityObjectDaopublic List getLockedContentBySpace(String spaceKey)
getLockedContentBySpace in interface ContentEntityObjectDaopublic String getObjectType(long id)
getObjectType in interface ContentEntityObjectDaopublic List<Page> getOrphanedPages(String spaceKey)
getOrphanedPages in interface PageDaopublic Page getPageById(long id)
PageDao
getPageById in interface PageDaoid - of the page to load
public Collection<Page> getPagesByIds(Collection<Long> ids)
getPagesByIds in interface PageDaopublic Page getPageByIdWithComments(long id)
PageDao
getPageByIdWithComments in interface PageDaoid - 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 PageDaopublic List<Page> getPagesCreatedOrUpdatedSinceDate(Date previousLoginDate)
getPagesCreatedOrUpdatedSinceDate in interface PageDao
public List<Page> getPagesStartingWith(Space space,
String s)
getPagesStartingWith in interface PageDaopublic List<Page> getPermissionPages(Space space)
getPermissionPages in interface PageDaopublic 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 PageDaopublic Iterator getRecentlyModifiedEntities(int maxResults)
getRecentlyModifiedEntities in interface ContentEntityObjectDao
public Iterator getRecentlyModifiedEntities(String spaceKey,
int maxResults)
getRecentlyModifiedEntities in interface ContentEntityObjectDaopublic Iterator getRecentlyModifiedEntitiesForUser(String username)
getRecentlyModifiedEntitiesForUser in interface ContentEntityObjectDaopublic List getRecentlyModifiedForChangeDigest(Date fromDate)
ContentEntityObjectDaoContentEntityObjects that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.
getRecentlyModifiedForChangeDigest in interface ContentEntityObjectDaofromDate - content modified after this date will be returned
ContentEntityObjects that have been newly added or modified
since the date specified
public List<Page> getRecentlyUpdatedPages(int maxCount,
String spaceKey)
getRecentlyUpdatedPages in interface PageDaopublic List<Page> getTopLevelPages(Space space)
getTopLevelPages in interface PageDaopublic Integer getMaxSiblingPosition(Page page)
PageDao
getMaxSiblingPosition in interface PageDaopage - The page whose siblings from which to get the max position
public Collection<Long> getPageIds(Space space)
PageDao
getPageIds in interface PageDaospace - space to retrieve page ids from, can not be null.
public List getTrashedContent(String spaceKey)
getTrashedContent in interface ContentEntityObjectDaopublic List<Page> getUndefinedPages(String spaceKey)
getUndefinedPages in interface PageDao
public ContentEntityObject getVersion(long originalVersionContentId,
int version)
getVersion in interface ContentEntityObjectDaopublic List<VersionHistorySummary> getVersionHistorySummary(long originalContentId)
getVersionHistorySummary in interface ContentEntityObjectDaopublic void refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
ObjectDao
refresh in interface ObjectDaopublic void replicate(Object objectToReplicate)
ObjectDao
replicate in interface ObjectDao
@Deprecated
public Page getPage(String spaceKey,
String pageTitle,
boolean eagerLoadComments)
PageDao
getPage in interface PageDaospaceKey - to match withpageTitle - to match witheagerLoadComments - true if comments should be loaded eagerly
@Deprecated
public Page getPage(String spaceKey,
String pageTitle)
getPage in interface PageDaopublic List<ContentEntityObject> getLastEditedVersionsOf(ContentEntityObject content)
ContentEntityObjectDao
getLastEditedVersionsOf in interface ContentEntityObjectDaocontent - content (must be the latest version)
public List<ContentEntityObject> findContentBySpaceIdAndStatus(long spaceId,
String status,
int offset,
int count)
ContentEntityObjectDao
findContentBySpaceIdAndStatus in interface ContentEntityObjectDaospaceId - the id of the spacestatus - the status of the content being retrieved (e.g. ContentEntityObject.DELETEDoffset - 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 ContentEntityObjectDaospaceId - 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 | |||||||||