com.atlassian.confluence.api.impl.service.content
Class ContentLabelServiceImpl

java.lang.Object
  extended by com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl
All Implemented Interfaces:
ContentLabelService

public class ContentLabelServiceImpl
extends Object
implements ContentLabelService


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.api.service.content.ContentLabelService
ContentLabelService.Validator
 
Constructor Summary
ContentLabelServiceImpl(ContentService contentService, LabelsService labelsService, ContentEntityManagerInternal contentEntityManager, AttachmentManager attachmentManager, PaginationService paginationService)
           
 
Method Summary
 PageResponse<Label> addLabels(ContentId contentId, Iterable<Label> labels)
          Adds the given labels to the specified content
 PageResponse<Label> getLabels(ContentId contentId, Collection<Label.Prefix> prefixes, PageRequest pageRequest)
          Get the labels attached to a given piece of content in the given namespaces
 void removeLabel(ContentId contentId, long labelId)
           
 com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl.ValidatorImpl validator()
          Provides a validator for validating actions on the ContentLabelService and checking permissions related to labels on Content
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentLabelServiceImpl

public ContentLabelServiceImpl(ContentService contentService,
                               LabelsService labelsService,
                               ContentEntityManagerInternal contentEntityManager,
                               AttachmentManager attachmentManager,
                               PaginationService paginationService)
Method Detail

getLabels

public PageResponse<Label> getLabels(ContentId contentId,
                                     Collection<Label.Prefix> prefixes,
                                     PageRequest pageRequest)
                              throws NotFoundException
Description copied from interface: ContentLabelService
Get the labels attached to a given piece of content in the given namespaces

Specified by:
getLabels in interface ContentLabelService
Parameters:
contentId - the id of the content to retrieve
prefixes - - the prefixes to filter the returned labels by, if empty no prefix filter is applied
pageRequest - - indicates how many labels to return and from what offset
Returns:
all the labels associated with the given content up to the limit of the page request, or a system defined limit
Throws:
NotFoundException - if the content does not exist, or is not viewable by the user

addLabels

public PageResponse<Label> addLabels(ContentId contentId,
                                     Iterable<Label> labels)
                              throws ServiceException
Description copied from interface: ContentLabelService
Adds the given labels to the specified content

Specified by:
addLabels in interface ContentLabelService
Parameters:
contentId - the id of the content to add labels to
labels - the label(s) that will be added
Returns:
all the labels that are associated with the specified content
Throws:
ServiceException - if at least one label is invalid. Provides an error message

removeLabel

public void removeLabel(ContentId contentId,
                        long labelId)
                 throws IllegalArgumentException
Throws:
IllegalArgumentException

validator

public com.atlassian.confluence.api.impl.service.content.ContentLabelServiceImpl.ValidatorImpl validator()
Description copied from interface: ContentLabelService
Provides a validator for validating actions on the ContentLabelService and checking permissions related to labels on Content

Specified by:
validator in interface ContentLabelService
Returns:
an contentLabelService Validator


Copyright © 2003–2015 Atlassian. All rights reserved.