com.atlassian.jira.issue.label
Interface LabelManager

All Known Implementing Classes:
DefaultLabelManager

public interface LabelManager

Manager responsible for adding/removing and getting labels for a particular issue and custom field combination.

Since:
v4.2

Method Summary
 Label addLabel(com.opensymphony.user.User remoteUser, java.lang.Long issueId, java.lang.Long customFieldId, java.lang.String label, boolean sendNotification)
          Adds a label to the issue and customFieldId provided.
 Label addLabel(com.opensymphony.user.User remoteUser, java.lang.Long issueId, java.lang.String label, boolean sendNotification)
          Adds a label to the issue provided.
 java.util.Set<Label> getLabels(java.lang.Long issueId)
          Returns all the labels for the given issue.
 java.util.Set<Label> getLabels(java.lang.Long issueId, java.lang.Long customFieldId)
          Returns all the labels for the given issue and custom field.
 java.util.Set<java.lang.String> getSuggestedLabels(com.opensymphony.user.User user, java.lang.Long issueId, java.lang.Long customFieldId, java.lang.String token)
          Returns a set of label suggestions sorted alphabetically for the label custom field provided.
 java.util.Set<java.lang.String> getSuggestedLabels(com.opensymphony.user.User user, java.lang.Long issueId, java.lang.String token)
          Returns a set of label suggestions sorted alphabetically for the labels system field.
 java.util.Set<java.lang.Long> removeLabelsForCustomField(java.lang.Long customFieldId)
          This method deletes all label entries for the custom field provided.
 java.util.Set<Label> setLabels(com.opensymphony.user.User remoteUser, java.lang.Long issueId, java.lang.Long customFieldId, java.util.Set<java.lang.String> labels, boolean sendNotification, boolean causeChangeNotification)
          Sets the labels for a particular issue and field combo to the set specified as a parameter.
 java.util.Set<Label> setLabels(com.opensymphony.user.User remoteUser, java.lang.Long issueId, java.util.Set<java.lang.String> labels, boolean sendNotification, boolean causeChangeNotification)
          Sets the labels for a particular issue to the set specified as a parameter.
 

Method Detail

getLabels

java.util.Set<Label> getLabels(java.lang.Long issueId)
Returns all the labels for the given issue.

Parameters:
issueId - The issue id that the label is linked against
Returns:
A set of alphabetically ordered labels for the issue.

setLabels

java.util.Set<Label> setLabels(com.opensymphony.user.User remoteUser,
                               java.lang.Long issueId,
                               java.util.Set<java.lang.String> labels,
                               boolean sendNotification,
                               boolean causeChangeNotification)
Sets the labels for a particular issue to the set specified as a parameter. The set may be an empty set in order to clear all labels for an issue.

Parameters:
remoteUser - The user setting labels
issueId - The issue id that the label is linked against
labels - the new labels for this issue
sendNotification - true if an e-mail should be sent to users notifying them of the issue update
causeChangeNotification - true if a change history should be created, false otherwise
Returns:
a set of stored label objects in alphabetical order

getLabels

java.util.Set<Label> getLabels(java.lang.Long issueId,
                               java.lang.Long customFieldId)
Returns all the labels for the given issue and custom field. The custom field may also be null, in which case the labels for the system field will be returned.

Parameters:
issueId - The issue id that the label is linked against
customFieldId - Custom field id for the labels CF or null if it's the system field.
Returns:
A set of alphabetically ordered labels for the issue and custom field.

setLabels

java.util.Set<Label> setLabels(com.opensymphony.user.User remoteUser,
                               java.lang.Long issueId,
                               java.lang.Long customFieldId,
                               java.util.Set<java.lang.String> labels,
                               boolean sendNotification,
                               boolean causeChangeNotification)
Sets the labels for a particular issue and field combo to the set specified as a parameter. The set may be an empty set in order to clear all labels for an issue.

Parameters:
remoteUser - The user setting labels
issueId - The issue id that the label is linked against
customFieldId - Custom field id for the labels CF or null if it's the system field.
labels - the new labels for this issue and custom field combo
sendNotification - true if an e-mail should be sent to users notifying them of the issue update
causeChangeNotification - true if a change history should be created, false otherwise
Returns:
a set of stored label objects in alphabetical order

addLabel

Label addLabel(com.opensymphony.user.User remoteUser,
               java.lang.Long issueId,
               java.lang.String label,
               boolean sendNotification)
Adds a label to the issue provided.

Parameters:
remoteUser - The user setting labels
issueId - The issue id that the label is linked against
label - The new label to add to the issue
sendNotification - true if an e-mail should be sent to users notifying them of the issue update
Returns:
The Label domain object which was created

addLabel

Label addLabel(com.opensymphony.user.User remoteUser,
               java.lang.Long issueId,
               java.lang.Long customFieldId,
               java.lang.String label,
               boolean sendNotification)
Adds a label to the issue and customFieldId provided.

Parameters:
remoteUser - The user setting labels
issueId - The issue id that the label is linked against
customFieldId - The id of the custom field to add the label to
label - The new label to add to the issue
sendNotification - true if an e-mail should be sent to users notifying them of the issue update
Returns:
The Label domain object which was created

removeLabelsForCustomField

java.util.Set<java.lang.Long> removeLabelsForCustomField(java.lang.Long customFieldId)
This method deletes all label entries for the custom field provided. This is useful when deleting a customfield

Parameters:
customFieldId - the custom field for which to delete labels
Returns:
a set of issue ids affected

getSuggestedLabels

java.util.Set<java.lang.String> getSuggestedLabels(com.opensymphony.user.User user,
                                                   java.lang.Long issueId,
                                                   java.lang.String token)
Returns a set of label suggestions sorted alphabetically for the labels system field. Suggestions will be narrowed down to the ones starting with the token provided and, if the issue is non-null, any labels the issue already has will be removed. If the token provided is null or empty, a set of labels sorted by popularity of the label will be returned.

Parameters:
user - The user retrieving suggestions for the labels system field
issueId - The issue for which suggestions should be generated or null
token - The search token entered by the user
Returns:
A sorted set of labels in alphabetical order

getSuggestedLabels

java.util.Set<java.lang.String> getSuggestedLabels(com.opensymphony.user.User user,
                                                   java.lang.Long issueId,
                                                   java.lang.Long customFieldId,
                                                   java.lang.String token)
Returns a set of label suggestions sorted alphabetically for the label custom field provided. Suggestions will be narrowed down to the ones starting with the token provided and, if the issue is non-null, any labels the issue already has will be removed. If the token provided is null or empty, a set of labels sorted by popularity of the label will be returned.

Parameters:
user - The user retrieving suggestions for the labels custom field
issueId - The issue for which suggestions should be generated or null
customFieldId - The label custom field to generate suggestions for
token - The search token entered by the user
Returns:
A sorted set of labels in alphabetical order


Copyright © 2002-2010 Atlassian. All Rights Reserved.