Class DefaultManagedConfigurationItemService
java.lang.Object
com.atlassian.jira.config.managedconfiguration.DefaultManagedConfigurationItemService
- All Implemented Interfaces:
ManagedConfigurationItemService
public class DefaultManagedConfigurationItemService
extends Object
implements ManagedConfigurationItemService
The default implementation of
ManagedConfigurationItemService.- Since:
- v5.2
-
Field Summary
Fields inherited from interface com.atlassian.jira.config.managedconfiguration.ManagedConfigurationItemService
SOURCE_PREFIX_PLUGIN -
Constructor Summary
ConstructorsConstructorDescriptionDefaultManagedConfigurationItemService(ManagedConfigurationItemStore managedConfigurationItemStore, PermissionManager permissionManager, com.atlassian.plugin.PluginAccessor pluginAccessor) -
Method Summary
Modifier and TypeMethodDescriptionbooleandoesUserHavePermission(ApplicationUser user, ConfigurationItemAccessLevel configurationItemAccessLevel) Determine if the specifiedApplicationUserwould have permission to edit anManagedConfigurationItemwith the specified level.booleanDetermine if the specifiedApplicationUserwould have permission to edit theManagedConfigurationItem.Retrieves all of theManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).getManagedCustomField(CustomField customField) Given theCustomField, attempt to retrieve theManagedConfigurationItemthat describes it.getManagedWorkflow(JiraWorkflow workflow) Given theJiraWorkflow, attempt to retrieve theManagedConfigurationItemthat describes it.getManagedWorkflowScheme(WorkflowScheme workflowScheme) Given theWorkflowScheme, attempt to retrieve theManagedConfigurationItemthat describes it.getManagedWorkflowScheme(Long schemeId) Given the workflow scheme ID, attempt to retrieve theManagedConfigurationItemthat describes it.Remove the registration of thisManagedConfigurationItem.Update the registration of thisManagedConfigurationItem.
-
Constructor Details
-
DefaultManagedConfigurationItemService
public DefaultManagedConfigurationItemService(ManagedConfigurationItemStore managedConfigurationItemStore, PermissionManager permissionManager, com.atlassian.plugin.PluginAccessor pluginAccessor)
-
-
Method Details
-
updateManagedConfigurationItem
@Nonnull public ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem(@Nonnull ManagedConfigurationItem item) Description copied from interface:ManagedConfigurationItemServiceUpdate the registration of thisManagedConfigurationItem. If the item was not previously managed, it will now be managed.- Specified by:
updateManagedConfigurationItemin interfaceManagedConfigurationItemService- Parameters:
item- the item to manage- Returns:
- the result; errors if saving the item failed
-
removeManagedConfigurationItem
@Nonnull public ServiceOutcome<Void> removeManagedConfigurationItem(@Nonnull ManagedConfigurationItem item) Description copied from interface:ManagedConfigurationItemServiceRemove the registration of thisManagedConfigurationItem. If the item was not previously managed, an error will be returned.- Specified by:
removeManagedConfigurationItemin interfaceManagedConfigurationItemService- Parameters:
item- the item to stop managing- Returns:
- the result; errors if saving the item failed
-
getManagedConfigurationItems
@Nonnull public Collection<ManagedConfigurationItem> getManagedConfigurationItems(@Nonnull ManagedConfigurationItemType type) Description copied from interface:ManagedConfigurationItemServiceRetrieves all of theManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).- Specified by:
getManagedConfigurationItemsin interfaceManagedConfigurationItemService- Parameters:
type- the type to retrieve- Returns:
- the items
-
getManagedCustomField
Description copied from interface:ManagedConfigurationItemServiceGiven theCustomField, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a JIRA custom field and the plugin is disabled) then the item can not be considered managed.
- Specified by:
getManagedCustomFieldin interfaceManagedConfigurationItemService- Parameters:
customField- the custom field- Returns:
- the item's representation
-
getManagedWorkflow
Description copied from interface:ManagedConfigurationItemServiceGiven theJiraWorkflow, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a workflow and the plugin is disabled) then the item can not be considered managed.
- Specified by:
getManagedWorkflowin interfaceManagedConfigurationItemService- Parameters:
workflow- the workflow- Returns:
- the item's representation
-
getManagedWorkflowScheme
@Nonnull public ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull WorkflowScheme workflowScheme) Description copied from interface:ManagedConfigurationItemServiceGiven theWorkflowScheme, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a workflow scheme and the plugin is disabled) then the item can not be considered managed.
- Specified by:
getManagedWorkflowSchemein interfaceManagedConfigurationItemService- Parameters:
workflowScheme- the workflow scheme- Returns:
- the item's representation
- See Also:
-
getManagedWorkflowScheme
Description copied from interface:ManagedConfigurationItemServiceGiven the workflow scheme ID, attempt to retrieve theManagedConfigurationItemthat describes it. If it does not exist, a default implementation will be returned.If the manager of this item is no longer available (e.g. if a plugin manages a workflow scheme and the plugin is disabled) then the item can not be considered managed.
- Specified by:
getManagedWorkflowSchemein interfaceManagedConfigurationItemService- Parameters:
schemeId- the workflow scheme ID- Returns:
- the item's representation
- See Also:
-
doesUserHavePermission
Description copied from interface:ManagedConfigurationItemServiceDetermine if the specifiedApplicationUserwould have permission to edit theManagedConfigurationItem.- Specified by:
doesUserHavePermissionin interfaceManagedConfigurationItemService- Parameters:
user- the useritem- the item- Returns:
- the result
-
doesUserHavePermission
public boolean doesUserHavePermission(ApplicationUser user, @Nonnull ConfigurationItemAccessLevel configurationItemAccessLevel) Description copied from interface:ManagedConfigurationItemServiceDetermine if the specifiedApplicationUserwould have permission to edit anManagedConfigurationItemwith the specified level.- Specified by:
doesUserHavePermissionin interfaceManagedConfigurationItemService- Parameters:
user- the userconfigurationItemAccessLevel- the level- Returns:
- the result
-