com.atlassian.confluence.ui.rest.service.content
Class AttachmentServiceImpl

java.lang.Object
  extended by com.atlassian.confluence.ui.rest.service.content.AttachmentServiceImpl
All Implemented Interfaces:
AttachmentService

public class AttachmentServiceImpl
extends Object
implements AttachmentService


Constructor Summary
AttachmentServiceImpl(AttachmentManager attachmentManager, PermissionManager permissionManager, LabelsService labelsService)
           
 
Method Summary
 Iterable<Label> addLabels(long attachmentId, Iterable<Label> labels)
          Adds the given labels to the specified content
 Iterable<Label> getLabels(long attachmentId, Collection<Label.Prefix> prefixes)
          Get the labels attached to a given attachment.
 void removeLabel(long attachmentId, long labelId)
          Remove a label with labelId from the specified content
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentServiceImpl

public AttachmentServiceImpl(AttachmentManager attachmentManager,
                             PermissionManager permissionManager,
                             LabelsService labelsService)
Method Detail

getLabels

public Iterable<Label> getLabels(long attachmentId,
                                 Collection<Label.Prefix> prefixes)
                          throws NotFoundException
Description copied from interface: AttachmentService
Get the labels attached to a given attachment.

Specified by:
getLabels in interface AttachmentService
Parameters:
attachmentId - id of the attachment to fetch labels for.
Throws:
NotFoundException - if the attachment does not exist, or is not viewable by the user

addLabels

public Iterable<Label> addLabels(long attachmentId,
                                 Iterable<Label> labels)
                          throws IllegalArgumentException
Description copied from interface: AttachmentService
Adds the given labels to the specified content

Specified by:
addLabels in interface AttachmentService
Parameters:
attachmentId - 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:
IllegalArgumentException - if at least one label is invalid. Provides an error message

removeLabel

public void removeLabel(long attachmentId,
                        long labelId)
                 throws IllegalArgumentException
Description copied from interface: AttachmentService
Remove a label with labelId from the specified content

Specified by:
removeLabel in interface AttachmentService
Parameters:
attachmentId - the id of the content to remove the label from
labelId - the id of the label to remove
Throws:
IllegalArgumentException - failed to remove the label


Copyright © 2003–2015 Atlassian. All rights reserved.