@ParametersAreNonnullByDefault public class DefaultSpaceManager extends Object implements SpaceManagerInternal
GLOBAL_LOGO| Constructor and Description |
|---|
DefaultSpaceManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
archiveSpace(Space space)
Archive the space.
|
@NonNull Space |
createPersonalSpace(String name,
@Nullable String description,
com.atlassian.user.User owner)
Creates a personal space.
|
@NonNull Space |
createPrivatePersonalSpace(String name,
@Nullable String description,
com.atlassian.user.User owner)
Create a personal Space for which only the creator has any permissions
|
@NonNull Space |
createPrivateSpace(String key,
String name,
@Nullable String description,
com.atlassian.user.User creator)
Creates a Space for which only the creator has any permissions
|
@NonNull Space |
createSpace(Space space)
Deprecated.
since 4.3. Use {#link #createSpace(String key, String name, String description, User creator)} instead
|
@NonNull Space |
createSpace(String key,
String name,
@Nullable String description,
com.atlassian.user.User creator) |
void |
ensureSpaceDescriptionExists(Space space)
If the given Space does not have a description, creates one for it, and saves it.
|
long |
findPageTotal(Space space)
Get the number of pages in a space.
|
@NonNull Collection<String> |
getAllSpaceKeys(SpaceStatus status)
Get the space keys of all spaces with the given status.
|
@NonNull List<Space> |
getAllSpaces()
Finds all spaces in Confluence, of any type, sorted alphabetically by space name.
|
@NonNull List<Space> |
getAllSpaces(SpacesQuery query)
Get a list of spaces specified by the
SpacesQuery. |
@NonNull List |
getAuthoredSpacesByUser(String username) |
@NonNull SpaceLogo |
getLogoForGlobalcontext() |
@NonNull SpaceLogo |
getLogoForSpace(@Nullable String spaceKey) |
int |
getNumberOfBlogPosts(Space space)
Get the number of blog posts in a space.
|
@Nullable Space |
getPersonalSpace(@Nullable ConfluenceUser user)
Get the personal space of the given user.
|
Space |
getSpace(long id)
Retrieve a space by its ID.
|
@Nullable Space |
getSpace(@Nullable String spaceKey)
Retrieve a space by its key.
|
@NonNull List<com.atlassian.user.User> |
getSpaceAdmins(Space space)
Returns a list of administrators for a given space, sorted by full name
|
@NonNull List<com.atlassian.user.User> |
getSpaceAdmins(Space space,
int limit)
Returns a list of administrators for a given space, sorted by full name, up to the size limit
|
@Nullable String |
getSpaceFromPageId(long pageId)
Get the key for a space from its pageId in a single db call
|
@NonNull ListBuilder<Space> |
getSpaces(SpacesQuery query)
Get a list of spaces specified by the
SpacesQuery limited by the offset and maxResults. |
@NonNull PageResponse<Space> |
getSpaces(SpacesQuery query,
LimitedRequest limitedRequest,
Predicate<? super Space>... filter)
get a paginated list of spaces that match the spaceQuery, filtered by the given predicate
|
@NonNull List |
getSpacesContainingCommentsBy(String username) |
@NonNull List |
getSpacesContainingPagesEditedBy(String username)
Returns
Pages that are either created or edited by the specified user |
@NonNull List<Space> |
getSpacesCreatedAfter(Date creationDate) |
@NonNull Boolean |
removeSpace(Space space)
Removes a space with a given spaceKey (case sensitive).
|
@NonNull Boolean |
removeSpace(String spaceKey,
com.atlassian.core.util.ProgressMeter progressMeter)
Removes a space with a given spaceKey (case sensitive).
|
void |
removeSpacesInGroup(SpaceGroup spaceGroup) |
void |
saveSpace(Space space) |
void |
saveSpace(Space space,
Space originalSpace) |
void |
setAccessModeManager(AccessModeManager accessModeManager) |
void |
setAttachmentManager(AttachmentManager attachmentManager) |
void |
setBulkPermissionService(BulkPermissionService bulkPermissionService) |
void |
setDenormalisedPermissionDarkFeature(DenormalisedPermissionDarkFeature denormalisedPermissionDarkFeature) |
void |
setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) |
void |
setGroupManager(com.atlassian.user.GroupManager groupManager) |
void |
setI18NBeanFactory(I18NBeanFactory i18NBeanFactory) |
void |
setIndexer(ConfluenceIndexer indexer)
Deprecated.
since 7.5 indexing now peformed via events
|
void |
setLabelManager(LabelManager labelManager) |
void |
setNotificationManager(NotificationManager notificationManager) |
void |
setPermissionCheckExemptions(PermissionCheckExemptions permissionCheckExemptions) |
void |
setSettingsManager(SettingsManager settingsManager) |
void |
setSpaceDao(SpaceDao spaceDao) |
void |
setSpaceDescriptionManager(SpaceDescriptionManager spaceDescriptionManager) |
void |
setSpacePermissionManager(SpacePermissionManagerInternal spacePermissionManager) |
void |
setSpacePermissionQueryManager(SpacePermissionQueryManager spacePermissionQueryManager) |
void |
setUserAccessor(UserAccessor userAccessor) |
@NonNull io.atlassian.fugue.Either<AccessDenied,SpacesQueryWithPermissionQueryBuilder> |
toSpacesQueryWithPermissionQueryBuilder(SpacesQuery spacesQuery)
Converts a
SpacesQuery into a decorated form SpacesQueryWithPermissionQueryBuilder that includes
information about how database queries should be built for the space permissions table. |
void |
unarchiveSpace(Space space)
Un-archive the space.
|
public void setSpaceDao(SpaceDao spaceDao)
public void setSpaceDescriptionManager(SpaceDescriptionManager spaceDescriptionManager)
public void setSpacePermissionManager(SpacePermissionManagerInternal spacePermissionManager)
public void setSpacePermissionQueryManager(SpacePermissionQueryManager spacePermissionQueryManager)
public Space getSpace(long id)
SpaceManagergetSpace in interface SpaceManagerid - the ID of the spacepublic @Nullable Space getSpace(@Nullable String spaceKey)
SpaceManagergetSpace in interface SpaceManagerspaceKey - the space key of the space to retrieve@Deprecated public void setIndexer(ConfluenceIndexer indexer)
public void setUserAccessor(UserAccessor userAccessor)
public void setGroupManager(com.atlassian.user.GroupManager groupManager)
public void setPermissionCheckExemptions(PermissionCheckExemptions permissionCheckExemptions)
public @NonNull Boolean removeSpace(Space space)
SpaceManager
Delegates to SpaceManager.removeSpace(String, com.atlassian.core.util.ProgressMeter).
removeSpace in interface SpaceManagerspace - the key of the space to removepublic @NonNull Boolean removeSpace(String spaceKey, com.atlassian.core.util.ProgressMeter progressMeter)
SpaceManagerremoveSpace in interface SpaceManagerspaceKey - the key of the space to removeprogressMeter - will be updated with status messages and percentage completed. Not Null.public void removeSpacesInGroup(SpaceGroup spaceGroup)
removeSpacesInGroup in interface SpaceManagerpublic void saveSpace(Space space)
saveSpace in interface SpaceManagerpublic void saveSpace(Space space, Space originalSpace)
saveSpace in interface SpaceManagerpublic @NonNull List<Space> getAllSpaces()
SpaceManagergetAllSpaces in interface SpaceManagerpublic @NonNull List getAuthoredSpacesByUser(String username)
getAuthoredSpacesByUser in interface SpaceManagerpublic @NonNull List getSpacesContainingPagesEditedBy(String username)
SpaceManagerPages that are either created or edited by the specified usergetSpacesContainingPagesEditedBy in interface SpaceManagerusername - a usernamePages that are either created or edited by the specified userpublic @NonNull List getSpacesContainingCommentsBy(String username)
getSpacesContainingCommentsBy in interface SpaceManagerpublic @NonNull Space createSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator)
createSpace in interface SpaceManagerpublic @NonNull Space createPrivateSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator)
SpaceManagercreatePrivateSpace in interface SpaceManagerpublic @NonNull Space createPersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner)
SpaceManagercreatePersonalSpace in interface SpaceManagerpublic @NonNull Space createPrivatePersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner)
SpaceManagercreatePrivatePersonalSpace in interface SpaceManager@Deprecated public @NonNull Space createSpace(Space space)
createSpace in interface SpaceManagerspace - the space to createpublic @Nullable Space getPersonalSpace(@Nullable ConfluenceUser user)
SpaceManagergetPersonalSpace in interface SpaceManageruser - the user to get the space for. If user is null, the method will return nullpublic long findPageTotal(Space space)
SpaceManagerfindPageTotal in interface SpaceManagerspace - the space to count pages inpublic void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
public int getNumberOfBlogPosts(Space space)
SpaceManagergetNumberOfBlogPosts in interface SpaceManagerspace - the space to count pages inpublic @Nullable String getSpaceFromPageId(long pageId)
SpaceManagergetSpaceFromPageId in interface SpaceManagerpageId - the id of the page to look forpublic void ensureSpaceDescriptionExists(Space space)
SpaceManagerThis is required for CONF-4080, because labels on a Space are attached to a Space Description.
ensureSpaceDescriptionExists in interface SpaceManagerspace - an existing space. Not null.public @NonNull List<Space> getSpacesCreatedAfter(Date creationDate)
getSpacesCreatedAfter in interface SpaceManagerpublic void setNotificationManager(NotificationManager notificationManager)
public void setLabelManager(LabelManager labelManager)
public void setAttachmentManager(AttachmentManager attachmentManager)
public void setSettingsManager(SettingsManager settingsManager)
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
public @NonNull SpaceLogo getLogoForSpace(@Nullable String spaceKey)
getLogoForSpace in interface SpaceManagerpublic @NonNull SpaceLogo getLogoForGlobalcontext()
getLogoForGlobalcontext in interface SpaceManagerpublic @NonNull ListBuilder<Space> getSpaces(SpacesQuery query)
SpaceManagerSpacesQuery limited by the offset and maxResults.getSpaces in interface SpaceManager@SafeVarargs public final @NonNull PageResponse<Space> getSpaces(SpacesQuery query, LimitedRequest limitedRequest, Predicate<? super Space>... filter)
SpaceManagerInternalgetSpaces in interface SpaceManagerInternalquery - - the query to use to fetch the spaces from the databaseslimitedRequest - - the pagination request limitfilter - - the filter to apply to the requested spacespublic @NonNull io.atlassian.fugue.Either<AccessDenied,SpacesQueryWithPermissionQueryBuilder> toSpacesQueryWithPermissionQueryBuilder(SpacesQuery spacesQuery)
SpaceManagerInternal
Converts a SpacesQuery into a decorated form SpacesQueryWithPermissionQueryBuilder that includes
information about how database queries should be built for the space permissions table.
This extra information is passed down to the DAO level so that SpaceDao doesn't have to call out to the
manager level to determine things like the user's AccessStatus, or construct extremely complex queries to
join and figure out the user's Confluence access.
If no permission check is defined in the SpacesQuery or the user is a super-user, then the returned
object excludes permission checking.
toSpacesQueryWithPermissionQueryBuilder in interface SpaceManagerInternalspacesQuery - the query to use to fetch the spaces from the databasesSpacesQuery decorated into a SpacesQueryWithPermissionQueryBuilder OR
AccessDenied if the user does not have Confluence access, or an invalid permission is being checked for
the user.public @NonNull List<Space> getAllSpaces(SpacesQuery query)
SpaceManagerSpacesQuery. Any code that calls this method is a potential
performance problem. The method may be deprecated and removed in a future version of Confluence. Use
SpaceManager.getSpaces(SpacesQuery) to retrieve pages of results instead.getAllSpaces in interface SpaceManagerpublic @NonNull List<com.atlassian.user.User> getSpaceAdmins(Space space)
SpaceManagergetSpaceAdmins in interface SpaceManagerpublic @NonNull List<com.atlassian.user.User> getSpaceAdmins(Space space, int limit)
SpaceManagergetSpaceAdmins in interface SpaceManagerpublic void setAccessModeManager(AccessModeManager accessModeManager)
public void setBulkPermissionService(BulkPermissionService bulkPermissionService)
public void setDenormalisedPermissionDarkFeature(DenormalisedPermissionDarkFeature denormalisedPermissionDarkFeature)
public void archiveSpace(Space space)
SpaceManagerarchiveSpace in interface SpaceManagerspace - the space to archive.public void unarchiveSpace(Space space)
SpaceManagerunarchiveSpace in interface SpaceManagerspace - the space to archive.public @NonNull Collection<String> getAllSpaceKeys(SpaceStatus status)
SpaceManagergetAllSpaceKeys in interface SpaceManagerstatus - the status to search forCopyright © 2003–2021 Atlassian. All rights reserved.