Class LabelServiceImpl
java.lang.Object
com.atlassian.confluence.api.impl.service.content.LabelServiceImpl
- All Implemented Interfaces:
LabelService
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.atlassian.confluence.api.service.content.LabelService
LabelService.Validator
-
Constructor Summary
ConstructorsConstructorDescriptionLabelServiceImpl
(PaginationService paginationService, LabelManagerInternal labelManager, LabelFactory labelFactory, LabelPermissionEnforcer labelPermissionEnforcer, com.atlassian.config.ApplicationConfiguration applicationConfig) -
Method Summary
Modifier and TypeMethodDescriptiongetLabelsByDetail
(PageRequest pageRequest, String labelName, String namespace, String spaceKey, String owner) Gets all labels with given namespace, label name, space and/or ownergetMostPopularLabels
(PageRequest pageRequest) Returns a paginated list of the most popular Labels used in a Confluence instance.getRecentlyUsedLabels
(PageRequest pageRequest) Returns a paginated list of the most recent Labels used in a Confluence instance.getRelatedLabels
(String labelName, int maxCount) getRelatedLabels
(String labelName, PageRequest pageRequest) Returns the labels related to the given label name, with a specified maximum number of results.Get the validator view ofLabelService
.
-
Constructor Details
-
LabelServiceImpl
public LabelServiceImpl(PaginationService paginationService, LabelManagerInternal labelManager, LabelFactory labelFactory, LabelPermissionEnforcer labelPermissionEnforcer, com.atlassian.config.ApplicationConfiguration applicationConfig)
-
-
Method Details
-
getLabelsByDetail
public PageResponse<Label> getLabelsByDetail(PageRequest pageRequest, String labelName, String namespace, String spaceKey, String owner) Description copied from interface:LabelService
Gets all labels with given namespace, label name, space and/or owner- Specified by:
getLabelsByDetail
in interfaceLabelService
- Parameters:
pageRequest
- contains the page request parameterslabelName
- The name of the label (null to ignore)namespace
- The namespace of the labels (null to ignore)spaceKey
- The spaceKey to restrict by (null to ignore)owner
- The owner of the labels (null to ignore)- Returns:
- a page response list of labels
-
getRelatedLabels
public PageResponse<Label> getRelatedLabels(String labelName, int maxCount) throws BadRequestException, NotFoundException - Specified by:
getRelatedLabels
in interfaceLabelService
- Throws:
BadRequestException
NotFoundException
-
getRelatedLabels
public PageResponse<Label> getRelatedLabels(String labelName, PageRequest pageRequest) throws BadRequestException, NotFoundException Description copied from interface:LabelService
Returns the labels related to the given label name, with a specified maximum number of results. Returns global labels only, i.e. label.namespace = 'global', with current retrieval logic in com.atlassian.confluence.labels.DefaultLabelManager#getRelatedLabels(com.atlassian.confluence.labels.Label, int), which may change in the future.- Specified by:
getRelatedLabels
in interfaceLabelService
- Parameters:
labelName
- The name of the label (namespace prefixes permitted)pageRequest
- the pagination parameters.- Returns:
PageResponse
with a list of related labels as its result, sorted by frequency of use.- Throws:
BadRequestException
- if the given label name is invalid, e.g. null, empty, or un-parsableNotFoundException
- if the given label name cannot be found
-
getRecentlyUsedLabels
Description copied from interface:LabelService
Returns a paginated list of the most recent Labels used in a Confluence instance.- Specified by:
getRecentlyUsedLabels
in interfaceLabelService
- Parameters:
pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
-
getMostPopularLabels
Description copied from interface:LabelService
Returns a paginated list of the most popular Labels used in a Confluence instance.- Specified by:
getMostPopularLabels
in interfaceLabelService
- Parameters:
pageRequest
- the pagination parameters.- Returns:
- Paginated list of labels.
-
validator
Description copied from interface:LabelService
Get the validator view ofLabelService
.- Specified by:
validator
in interfaceLabelService
-