Interface SpaceService
- All Known Implementing Classes:
SpaceServiceImpl
public interface SpaceService
Provides CRUD operations on Spaces.
- Since:
- 5.5
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
A finder interface to encapsulate finding content in a particular spacestatic interface
A finder for locating spaces.static interface
Provides methods for validating the create, update and delete methods. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Archives a space.Create a new space.Delete the given space.Create a space finder to locate spaces, the expansions will be applied to each Space matching the restrictions on the finder.findAllContentLabelsPaginated
(String spaceKey, PageRequest pageRequest) Returns a paginated list of all Labels used by Content within the given Space.findContent
(Space space, Expansion... expansion) A finder to locate content in the spacefindPopularContentLabelsPaginated
(String spaceKey, PageRequest pageRequest) Returns a paginated list of the most popular Labels used by Content within the given Space.findRecentContentLabelsPaginated
(String spaceKey, PageRequest pageRequest) Returns a paginated list of the most 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.void
Un-archives a space.Updates a space.Get the validator view of the Space Service.
-
Method Details
-
create
Create a new space.If the "isPrivate" flag is set to true the new space will only be visible to the creator.
Minimum properties to be valid is a key and name.
- Parameters:
newSpace
- the space to createisPrivate
- whether the space is private (true) or has default permissions (false)- Returns:
- the space created
- Throws:
ServiceException
- if the space cannot be created
-
update
Updates a space.Currently limited to changing the space name, description and homepage.
- Parameters:
space
- the updatedSpace
- Returns:
- the updated space after being persisted
- Throws:
ServiceException
-
find
Create a space finder to locate spaces, the expansions will be applied to each Space matching the restrictions on the finder. Restrictions can be applied to the finder using the appropriate withFoo() methodFor example:
spaceService.find() .withKeys("DEV","PROD") .fetchMany(new SimplePageRequest(0, 10);
- Parameters:
expansion
- - the expansion to apply to each fetched space- Returns:
- a new SpaceFinder
-
findAllContentLabelsPaginated
Returns a paginated list of all Labels used by Content within the given Space.- Parameters:
spaceKey
- the key of the Space the User is attempting to search.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
- Since:
- 8.9.0
-
findPopularContentLabelsPaginated
Returns a paginated list of the most popular Labels used by Content within the given Space.- Parameters:
spaceKey
- the key of the Space the User is attempting to search.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
- Since:
- 8.9.0
-
findRecentContentLabelsPaginated
Returns a paginated list of the most recent Labels used by Content within the given Space.- Parameters:
spaceKey
- the key of the Space the User is attempting to search.pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
- Since:
- 8.9.0
-
findRelatedContentLabelsPaginated
PageResponse<Label> findRelatedContentLabelsPaginated(String spaceKey, String labelName, PageRequest pageRequest) 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.- 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.
- Since:
- 8.9.0
-
archive
Archives a space. If the space is already archived, this method does nothing.- Parameters:
spaceKey
- the key of the space to archive- Since:
- 8.8.0
-
restore
Un-archives a space. If the space is already unarchived, this method does nothing.- Parameters:
spaceKey
- the key of the space to restore- Since:
- 8.8.0
-
findContent
SpaceService.SpaceContentFinder findContent(Space space, Expansion... expansion) throws NotFoundException A finder to locate content in the space- Returns:
- a finder
- Throws:
NotFoundException
- if the space does not exist or you do not have permission to view it
-
delete
Delete the given space.The deletion happens asynchronously so a LongTaskStatus is returned, that can be used to track progress.
- Parameters:
spaceToDelete
- the space to delete- Returns:
- a LongTaskStatus describing the space-removal operation
- Throws:
NotFoundException
- if the space does not exist or you do not have permission to view itPermissionException
- if you do not have permission to delete the spaceServiceException
-
validator
SpaceService.Validator validator()Get the validator view of the Space Service.
-