Class RemoteSpaceServiceImpl
java.lang.Object
com.atlassian.confluence.rest.client.AbstractRemoteService<SpaceService>
com.atlassian.confluence.rest.client.RemoteSpaceServiceImpl
- All Implemented Interfaces:
RemoteSpaceService
public class RemoteSpaceServiceImpl
extends AbstractRemoteService<SpaceService>
implements RemoteSpaceService
SpaceService implementation that communicates with Confluence remotely using the Confluence REST api
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
Nested classes/interfaces inherited from interface com.atlassian.confluence.rest.client.RemoteSpaceService
RemoteSpaceService.RemoteSpaceContentFinder, RemoteSpaceService.RemoteSpaceFinder, RemoteSpaceService.RemoteSpaceSingleFetcher
-
Field Summary
FieldsFields inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
provider
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteSpaceServiceImpl
(AuthenticatedWebResourceProvider provider, ExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionArchives a space.createCompletionStage
(Space newSpace, boolean isPrivate) Create a new space.createPersonalSpaceForSelf
(PersonalSpaceDetailsForCreation spaceDetails) Create a personal space for self.createPersonalSpaceForUser
(PersonalSpaceDetailsForCreation spaceDetails, String username) Create a personal space for a user by username.deleteCompletionStage
(long spaceId) Deletes space.deleteCompletionStage
(Space space) Delete the given space.deleteSynchronouslyCompletionStage
(long spaceId) Deletes space synchronously.emptyTrash
(String spaceKey) Purge all the trash in a given space.findAllContentLabelsPaginated
(String spaceKey, PageRequest pageRequest) Returns a paginated list of all Labels used by Content within the given Space.findContent
(Space space, Expansion... expansion) Create a finder to find content in the given space.findPopularContentLabelsPaginated
(String spaceKey, PageRequest pageRequest) Returns a paginated list of the popular Labels used by Content within the given Space.findRecentContentLabelsPaginated
(String spaceKey, PageRequest pageRequest) Returns a paginated list of the recent Labels used by Content within the given Space.findRelatedContentLabelsPaginated
(String spaceKey, String labelName, PageRequest pageRequest) Returns a paginated list of related Labels used by Content within the given Space.Un-archives a space.updateCompletionStage
(Space space) Updates a space.Get the validator view of the Space Service.Methods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteCompletionStage, deleteCompletionStage, getCompletionStage, getCompletionStageGenericCollection, getCompletionStageMap, getCompletionStageMapOfGenericListResponse, getCompletionStageMapOfPageResponses, getCompletionStageOptional, getCompletionStagePageResponseList, getCompletionStageSearchPageResponseList, getExecutor, newExperimentalRestWebTarget, newWebTarget, postCompletionStage, postCompletionStage, postCompletionStage, postCompletionStageToPageResponse, postVoidCompletionStage, putCompletionStage, putVoidCompletionStage
-
Field Details
-
SPACE_RESOURCE_PATH
- See Also:
-
PRIVATE_SPACE_SUBPATH
- See Also:
-
PERSONAL_SPACE_SUBPATH
- See Also:
-
-
Constructor Details
-
RemoteSpaceServiceImpl
- Since:
- 9.0
-
-
Method Details
-
createCompletionStage
public CompletionStage<Space> createCompletionStage(Space newSpace, boolean isPrivate) throws ServiceException Description copied from interface:RemoteSpaceService
Create a new space.Minimum properties to be valid is a key and name.
- Specified by:
createCompletionStage
in interfaceRemoteSpaceService
- Parameters:
newSpace
- the space to createisPrivate
- true if the space should only be visible to its creator- Returns:
- the space created
- Throws:
ServiceException
- if the space cannot be created
-
createPersonalSpaceForSelf
public CompletionStage<Space> createPersonalSpaceForSelf(PersonalSpaceDetailsForCreation spaceDetails) throws ServiceException Description copied from interface:RemoteSpaceService
Create a personal space for self.If the "isPrivate" flag is set to true the personal space will only be visible to the owner.
- Specified by:
createPersonalSpaceForSelf
in interfaceRemoteSpaceService
- Parameters:
spaceDetails
- Details of a Personal Space to be created- Returns:
- the space created
- Throws:
ServiceException
- if the space cannot be created
-
createPersonalSpaceForUser
public CompletionStage<Space> createPersonalSpaceForUser(PersonalSpaceDetailsForCreation spaceDetails, String username) throws ServiceException Description copied from interface:RemoteSpaceService
Create a personal space for a user by username.If the "isPrivate" flag is set to true the personal space will only be visible to the owner.
- Specified by:
createPersonalSpaceForUser
in interfaceRemoteSpaceService
- Parameters:
spaceDetails
- Details of a Personal Space to be createdusername
- Username of the user to create personal space for- Returns:
- the space created
- Throws:
ServiceException
- if the space cannot be created
-
updateCompletionStage
Description copied from interface:RemoteSpaceService
Updates a space.Currently limited to changing the space name, description and homepage.
- Specified by:
updateCompletionStage
in interfaceRemoteSpaceService
- Parameters:
space
- the updatedSpace
- Returns:
- the updated space after being persisted
- Throws:
ServiceException
-
find
- Specified by:
find
in interfaceRemoteSpaceService
-
findAllContentLabelsPaginated
public CompletionStage<PageResponse<Label>> findAllContentLabelsPaginated(String spaceKey, PageRequest pageRequest) Description copied from interface:RemoteSpaceService
Returns a paginated list of all Labels used by Content within the given Space.- Specified by:
findAllContentLabelsPaginated
in interfaceRemoteSpaceService
- Parameters:
spaceKey
- the key of the Space the User is attempting to search.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
-
findPopularContentLabelsPaginated
public CompletionStage<PageResponse<Label>> findPopularContentLabelsPaginated(String spaceKey, PageRequest pageRequest) Description copied from interface:RemoteSpaceService
Returns a paginated list of the popular Labels used by Content within the given Space.- Specified by:
findPopularContentLabelsPaginated
in interfaceRemoteSpaceService
- Parameters:
spaceKey
- the key of the Space the User is attempting to search.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
-
findRecentContentLabelsPaginated
public CompletionStage<PageResponse<Label>> findRecentContentLabelsPaginated(String spaceKey, PageRequest pageRequest) Description copied from interface:RemoteSpaceService
Returns a paginated list of the recent Labels used by Content within the given Space.- Specified by:
findRecentContentLabelsPaginated
in interfaceRemoteSpaceService
- Parameters:
spaceKey
- the key of the Space the User is attempting to search.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
-
findRelatedContentLabelsPaginated
public CompletionStage<PageResponse<Label>> findRelatedContentLabelsPaginated(String spaceKey, String labelName, PageRequest pageRequest) Description copied from interface:RemoteSpaceService
Returns a paginated list of related Labels used by Content within the given Space. A Label is defined as being related to another when it is found attached to the same Content as the Label specified in the request.- Specified by:
findRelatedContentLabelsPaginated
in interfaceRemoteSpaceService
- Parameters:
spaceKey
- the key of the Space the User is attempting to search.labelName
- the Label to match on.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
-
archive
Description copied from interface:RemoteSpaceService
Archives a space. If the space is already archived, this method does nothing.- Specified by:
archive
in interfaceRemoteSpaceService
-
restore
Description copied from interface:RemoteSpaceService
Un-archives a space. If the space is already unarchived, this method does nothing.- Specified by:
restore
in interfaceRemoteSpaceService
-
emptyTrash
Description copied from interface:RemoteSpaceService
Purge all the trash in a given space.- Specified by:
emptyTrash
in interfaceRemoteSpaceService
- Parameters:
spaceKey
- the key of the space to empty trash
-
validator
Description copied from interface:RemoteSpaceService
Get the validator view of the Space Service.- Specified by:
validator
in interfaceRemoteSpaceService
-
findContent
Description copied from interface:RemoteSpaceService
Create a finder to find content in the given space. Content will be returned upon calling one of the fetch methods on the returned finder- Specified by:
findContent
in interfaceRemoteSpaceService
- Parameters:
space
- - the space to fetch content forexpansion
- - the expansions to apply to the content in this space- Returns:
- a new space content finder with the space and expansions set
-
deleteCompletionStage
Description copied from interface:RemoteSpaceService
Delete the given space.The deletion happens asynchronously so a LongTaskSubmission is returned, that can be used to request status.
- Specified by:
deleteCompletionStage
in interfaceRemoteSpaceService
- Parameters:
space
- the space to delete- Returns:
- a LongTaskStatus describing the space-removal operation
-
deleteCompletionStage
Description copied from interface:RemoteSpaceService
Deletes space. It removes space permissions and rename the space key, so the space key can be re-used immediately. Alter that, all remaining space content will be removed in background. Neither instance restart nor problems with the database will not prevent data deletion. It will not leave partial data in the database.- Specified by:
deleteCompletionStage
in interfaceRemoteSpaceService
- Parameters:
spaceId
- space id
-
deleteSynchronouslyCompletionStage
Description copied from interface:RemoteSpaceService
Deletes space synchronously. It is NOT RECOMMENDED to use in production code, this method should be used in tests to remove space data quickly. Using regular space deletion is not recommended in tests because while one test is being running, data from the previous test could be still being deleted. It could be a source of flakiness. Instance restart will interrupt the process, so some space content can remain in the database.- Specified by:
deleteSynchronouslyCompletionStage
in interfaceRemoteSpaceService
- Parameters:
spaceId
- space id
-