Package com.atlassian.jira.issue.label
Class DefaultLabelManager
java.lang.Object
com.atlassian.jira.issue.label.DefaultLabelManager
- All Implemented Interfaces:
IdentifiableComponent,LabelManager
Manager responsible for label operations.
- Since:
- v4.2
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLabelManager(LabelStore labelStore, IssueManager issueManager, IssueUpdater issueUpdater, LabelSuggester labelSuggester) -
Method Summary
Modifier and TypeMethodDescriptionaddLabel(ApplicationUser remoteUser, Long issueId, Long customFieldId, String label, boolean sendNotification) Adds a label to the issue and customFieldId provided.addLabel(ApplicationUser remoteUser, Long issueId, String label, boolean sendNotification) Adds a label to the issue provided.getCustomFieldLabels(Long issueId) Returns all custom field labels for the given issue.getCustomFieldLabels(Set<Long> issueIds) Returns all custom field labels for the given issue batch.protected CustomFieldManagerReturns system field labels for the given issue.Returns all the labels for the given issue and custom field.getSuggestedLabels(ApplicationUser user, Long issueId, Long customFieldId, String token) Returns a set of label suggestions sorted alphabetically for the label custom field provided.getSuggestedLabels(ApplicationUser user, Long issueId, String token) Returns a set of label suggestions sorted alphabetically for the labels system field.removeLabelsForCustomField(Long customFieldId) This method deletes all label entries for the custom field provided.setLabels(ApplicationUser remoteUser, Long issueId, Long customFieldId, Set<String> labels, boolean sendNotification, boolean causesChangeNotification) Sets the labels for a particular issue and field combo to the set specified as a parameter.setLabels(ApplicationUser remoteUser, Long issueId, Set<String> labels, boolean sendNotification, boolean causesChangeNotification) Sets the labels for a particular issue to the set specified as a parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.component.IdentifiableComponent
getIdentity
-
Constructor Details
-
DefaultLabelManager
public DefaultLabelManager(LabelStore labelStore, IssueManager issueManager, IssueUpdater issueUpdater, LabelSuggester labelSuggester)
-
-
Method Details
-
getFieldManager
-
getLabels
Description copied from interface:LabelManagerReturns system field labels for the given issue.- Specified by:
getLabelsin interfaceLabelManager- Parameters:
issueId- The issue id that the label is linked against- Returns:
- A set of alphabetically ordered labels for the issue.
-
setLabels
public Set<Label> setLabels(ApplicationUser remoteUser, Long issueId, Set<String> labels, boolean sendNotification, boolean causesChangeNotification) Description copied from interface:LabelManagerSets 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.- Specified by:
setLabelsin interfaceLabelManager- Parameters:
remoteUser- The user setting labelsissueId- The issue id that the label is linked againstlabels- the new labels for this issuesendNotification- true if an e-mail should be sent to users notifying them of the issue updatecausesChangeNotification- true if a change history should be created, false otherwise- Returns:
- a set of stored label objects in alphabetical order
-
getLabels
Description copied from interface:LabelManagerReturns 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.- Specified by:
getLabelsin interfaceLabelManager- Parameters:
issueId- The issue id that the label is linked againstcustomFieldId- 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
public Set<Label> setLabels(ApplicationUser remoteUser, Long issueId, Long customFieldId, Set<String> labels, boolean sendNotification, boolean causesChangeNotification) Description copied from interface:LabelManagerSets 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.- Specified by:
setLabelsin interfaceLabelManager- Parameters:
remoteUser- The user setting labelsissueId- The issue id that the label is linked againstcustomFieldId- 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 combosendNotification- true if an e-mail should be sent to users notifying them of the issue updatecausesChangeNotification- true if a change history should be created, false otherwise- Returns:
- a set of stored label objects in alphabetical order
-
addLabel
public Label addLabel(ApplicationUser remoteUser, Long issueId, String label, boolean sendNotification) Description copied from interface:LabelManagerAdds a label to the issue provided.- Specified by:
addLabelin interfaceLabelManager- Parameters:
remoteUser- The user setting labelsissueId- The issue id that the label is linked againstlabel- The new label to add to the issuesendNotification- 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
public Label addLabel(ApplicationUser remoteUser, Long issueId, Long customFieldId, String label, boolean sendNotification) Description copied from interface:LabelManagerAdds a label to the issue and customFieldId provided.- Specified by:
addLabelin interfaceLabelManager- Parameters:
remoteUser- The user setting labelsissueId- The issue id that the label is linked againstcustomFieldId- The id of the custom field to add the label tolabel- The new label to add to the issuesendNotification- 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
Description copied from interface:LabelManagerThis method deletes all label entries for the custom field provided. This is useful when deleting a customfield- Specified by:
removeLabelsForCustomFieldin interfaceLabelManager- Parameters:
customFieldId- the custom field for which to delete labels- Returns:
- a set of issue ids affected
-
getSuggestedLabels
Description copied from interface:LabelManagerReturns 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.- Specified by:
getSuggestedLabelsin interfaceLabelManager- Parameters:
user- The user retrieving suggestions for the labels system fieldissueId- The issue for which suggestions should be generated ornulltoken- The search token entered by the user- Returns:
- A sorted set of labels in alphabetical order
-
getSuggestedLabels
public Set<String> getSuggestedLabels(ApplicationUser user, Long issueId, Long customFieldId, String token) Description copied from interface:LabelManagerReturns 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.- Specified by:
getSuggestedLabelsin interfaceLabelManager- Parameters:
user- The user retrieving suggestions for the labels custom fieldissueId- The issue for which suggestions should be generated ornullcustomFieldId- The label custom field to generate suggestions fortoken- The search token entered by the user- Returns:
- A sorted set of labels in alphabetical order
-
getCustomFieldLabels
Description copied from interface:LabelManagerReturns all custom field labels for the given issue.- Specified by:
getCustomFieldLabelsin interfaceLabelManager- Parameters:
issueId- The issue id that the label is linked against- Returns:
- A set of custom field labels for the issue.
-
getCustomFieldLabels
Description copied from interface:LabelManagerReturns all custom field labels for the given issue batch.- Specified by:
getCustomFieldLabelsin interfaceLabelManager- Parameters:
issueIds- The issue ids that the labels are linked against- Returns:
- A set of custom field labels grouped by issues.
-