Interface SpaceDao
- All Known Subinterfaces:
SpaceDaoInternal
- All Known Implementing Classes:
HibernateSpaceDao
@ParametersAreNonnullByDefault
public interface SpaceDao
-
Method Summary
Modifier and TypeMethodDescriptionint
countSpaces
(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder) Count the spaces specified by theSpacesQuery
.int
findPageTotal
(Space space) Fast way to count pages in a space without loading them.@NonNull Collection<String>
findSpaceKeysWithStatus
(String status) find all space keys where the space status is equal to the given status.@NonNull String
findUniqueVersionOfSpaceKey
(String spaceKey) Return a unique version of the supplied spaceKey.@Nullable Space
getById
(long id) int
getNumberOfBlogPosts
(Space space) Fast way to count blog posts in a space without loading them.@Nullable Space
getPersonalSpace
(@Nullable ConfluenceUser user) @Nullable Space
Find a space by its space key.@Nullable Space
getSpaceByContentId
(long contentId) Get the space that some content belongs to in a single db query.getSpaces
(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder) Get a list of spaces specified by theSpacesQuery
.getSpaces
(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder, int offset, int maxResults) Get a list of spaces specified by theSpacesQueryWithPermissionQueryBuilder
.getSpacesContainingCommentsByUser
(@Nullable ConfluenceUser user) Find all spaces containing comments by a particular user.getSpacesContainingPagesEditedByUser
(@Nullable ConfluenceUser user) Find all spaces containing pages that were edited by a particular user.getSpacesCreatedAfter
(Date creationDate) getSpacesCreatedByUser
(@Nullable ConfluenceUser username) Find all the spaces created by a given user.getSpacesCreatedOrUpdatedSinceDate
(Date previousLoginDate) void
performOnAll
(Consumer<Space> function) Perform the task with all spaces.
-
Method Details
-
getById
-
getSpace
Find a space by its space key. -
getSpacesCreatedByUser
Find all the spaces created by a given user.- Since:
- 9.0
-
getPersonalSpace
- Parameters:
user
- the user who's personal space is to be retrieved- Returns:
- the personal space for the specified user or null if none exists
-
getSpacesContainingPagesEditedByUser
Find all spaces containing pages that were edited by a particular user. This is for tracking down whether a user can be safely deleted or not.- Parameters:
user
- the user to track down- Returns:
- a list of the spaces containing pages that were edited by this user, or the empty list if no such spaces exist.
- Since:
- 9.0
-
getSpacesContainingCommentsByUser
Find all spaces containing comments by a particular user. This is for tracking down whether a user can be safely deleted or not.Does currently not include personal spaces, but probably should.
- Parameters:
user
- the user to track down- Returns:
- a list of the spaces containing comments by this user, or the empty list if no such spaces exist.
- Since:
- 9.0
-
getSpacesCreatedOrUpdatedSinceDate
-
findPageTotal
Fast way to count pages in a space without loading them. Counts all pages, not just the current versions.- Returns:
- returns the number of all versions of all pages in a space
-
getNumberOfBlogPosts
Fast way to count blog posts in a space without loading them. Counts all blog posts, not just the current versions.- Returns:
- returns the number of all versions of all blog posts in a space
-
getSpacesCreatedAfter
-
getSpaces
@NonNull List<Space> getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder, int offset, int maxResults) Get a list of spaces specified by theSpacesQueryWithPermissionQueryBuilder
.- Since:
- 5.9
-
getSpaces
@NonNull List<Space> getSpaces(SpacesQueryWithPermissionQueryBuilder queryWithPermissionClauseBuilder) Get a list of spaces specified by theSpacesQuery
. Its recommended to use thegetSpaces(SpacesQueryWithPermissionQueryBuilder, int, int)
form of this method where ever possible.- Since:
- 5.9
-
countSpaces
Count the spaces specified by theSpacesQuery
.- Since:
- 5.9
-
getSpaceByContentId
Get the space that some content belongs to in a single db query. This will only work for content that directly belongs to a space (i.e. Pages, Blog Posts, Space Descriptions but not Comments or Attachments) and it will only work for current content (old content is dissassociated from its space)- Parameters:
contentId
- the ID of the content- Returns:
- the space that content belongs to
-
findSpaceKeysWithStatus
find all space keys where the space status is equal to the given status.- Parameters:
status
- the status to search for- Returns:
- all space keys of spaces that match that status
-
findUniqueVersionOfSpaceKey
Return a unique version of the supplied spaceKey. This is done by checking the database for a duplicate and following the algorithm of counting up until a duplicate is achieved e.g. spaceKey_1, spaceKey_2, etc.- Parameters:
spaceKey
- the space key to create a unique version of- Returns:
- the unique space key
-
performOnAll
Perform the task with all spaces.- Parameters:
function
- apply to spaces.
-