Package com.atlassian.jira.issue.label
Class CachingLabelStore
java.lang.Object
com.atlassian.jira.issue.label.CachingLabelStore
- All Implemented Interfaces:
Startable,InitializingComponent,LabelStore
public class CachingLabelStore
extends Object
implements LabelStore, Startable, InitializingComponent
Caching implementation of the Label store, that caches labels in a weakhashmap based on the issue/field combination.
- Since:
- v4.2
-
Constructor Summary
ConstructorsConstructorDescriptionCachingLabelStore(OfBizLabelStore delegateStore, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionAdds a new label to the issue for the custom field specified.voidCalled after all the beans are constructed and the ApplicationContext is fully populated.getLabels(long issueId) Returns all labels for the given issue.Returns all the labels for the given issue and custom field.Returns all labels for the given issues batch.voidonClearCache(ClearCacheEvent event) voidremoveLabel(Long labelId, Long issueId, Long customFieldId) Removes the label identified by idremoveLabelsForCustomField(Long customFieldId) Deletes all labels for a given custom field.Sets the labels for a particular issue and field combo to the set specified as a parameter.voidstart()This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-
Constructor Details
-
CachingLabelStore
public CachingLabelStore(OfBizLabelStore delegateStore, com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
getLabels
Description copied from interface:LabelStoreReturns 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 interfaceLabelStore- 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
Description copied from interface:LabelStoreSets 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 interfaceLabelStore- 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.labels- the new labels for this issue and custom field combo- Returns:
- a set of stored label objects in alphabetical order
-
addLabel
Description copied from interface:LabelStoreAdds a new label to the issue for the custom field specified. If the customFieldId is null, the label will be added for the system field. Adding an existing label again, will simply return the existing label.- Specified by:
addLabelin interfaceLabelStore- 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.label- The new label to add- Returns:
- The Label object that was added
-
removeLabel
Description copied from interface:LabelStoreRemoves the label identified by id- Specified by:
removeLabelin interfaceLabelStore- Parameters:
labelId- The id of the label to deleteissueId- The issue id that the label is linked againstcustomFieldId- Custom field id for the labels CF or null if it's the system field.
-
removeLabelsForCustomField
Description copied from interface:LabelStoreDeletes all labels for a given custom field. This is useful when deleting a custom field.- Specified by:
removeLabelsForCustomFieldin interfaceLabelStore- Parameters:
customFieldId- The custom field id for which to delete labels- Returns:
- A set of issueids affected by this operation
-
getLabels
Description copied from interface:LabelStoreReturns all labels for the given issue.- Specified by:
getLabelsin interfaceLabelStore- Parameters:
issueId- The issue id that the label is linked against- Returns:
- A collection of labels for the issue.
-
getLabels
Description copied from interface:LabelStoreReturns all labels for the given issues batch.- Specified by:
getLabelsin interfaceLabelStore- Parameters:
issueIds- The issue ids that the labels are linked against- Returns:
- A collection of labels grouped by the issues.
-
start
Description copied from interface:StartableThis method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-