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 TypeMethodDescriptionboolean
doesUserHavePermission
(ApplicationUser user, ConfigurationItemAccessLevel configurationItemAccessLevel) Determine if the specifiedApplicationUser
would have permission to edit anManagedConfigurationItem
with the specified level.boolean
Determine if the specifiedApplicationUser
would have permission to edit theManagedConfigurationItem
.Retrieves all of theManagedConfigurationItem
s of the specified type which are currently "available" (meaning their owner is currently available).getManagedCustomField
(CustomField customField) Given theCustomField
, attempt to retrieve theManagedConfigurationItem
that describes it.getManagedWorkflow
(JiraWorkflow workflow) Given theJiraWorkflow
, attempt to retrieve theManagedConfigurationItem
that describes it.getManagedWorkflowScheme
(WorkflowScheme workflowScheme) Given theWorkflowScheme
, attempt to retrieve theManagedConfigurationItem
that describes it.getManagedWorkflowScheme
(Long schemeId) Given the workflow scheme ID, attempt to retrieve theManagedConfigurationItem
that 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:ManagedConfigurationItemService
Update the registration of thisManagedConfigurationItem
. If the item was not previously managed, it will now be managed.- Specified by:
updateManagedConfigurationItem
in 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:ManagedConfigurationItemService
Remove the registration of thisManagedConfigurationItem
. If the item was not previously managed, an error will be returned.- Specified by:
removeManagedConfigurationItem
in 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:ManagedConfigurationItemService
Retrieves all of theManagedConfigurationItem
s of the specified type which are currently "available" (meaning their owner is currently available).- Specified by:
getManagedConfigurationItems
in interfaceManagedConfigurationItemService
- Parameters:
type
- the type to retrieve- Returns:
- the items
-
getManagedCustomField
Description copied from interface:ManagedConfigurationItemService
Given theCustomField
, attempt to retrieve theManagedConfigurationItem
that 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:
getManagedCustomField
in interfaceManagedConfigurationItemService
- Parameters:
customField
- the custom field- Returns:
- the item's representation
-
getManagedWorkflow
Description copied from interface:ManagedConfigurationItemService
Given theJiraWorkflow
, attempt to retrieve theManagedConfigurationItem
that 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:
getManagedWorkflow
in interfaceManagedConfigurationItemService
- Parameters:
workflow
- the workflow- Returns:
- the item's representation
-
getManagedWorkflowScheme
@Nonnull public ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull WorkflowScheme workflowScheme) Description copied from interface:ManagedConfigurationItemService
Given theWorkflowScheme
, attempt to retrieve theManagedConfigurationItem
that 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:
getManagedWorkflowScheme
in interfaceManagedConfigurationItemService
- Parameters:
workflowScheme
- the workflow scheme- Returns:
- the item's representation
- See Also:
-
getManagedWorkflowScheme
Description copied from interface:ManagedConfigurationItemService
Given the workflow scheme ID, attempt to retrieve theManagedConfigurationItem
that 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:
getManagedWorkflowScheme
in interfaceManagedConfigurationItemService
- Parameters:
schemeId
- the workflow scheme ID- Returns:
- the item's representation
- See Also:
-
doesUserHavePermission
Description copied from interface:ManagedConfigurationItemService
Determine if the specifiedApplicationUser
would have permission to edit theManagedConfigurationItem
.- Specified by:
doesUserHavePermission
in interfaceManagedConfigurationItemService
- Parameters:
user
- the useritem
- the item- Returns:
- the result
-
doesUserHavePermission
public boolean doesUserHavePermission(ApplicationUser user, @Nonnull ConfigurationItemAccessLevel configurationItemAccessLevel) Description copied from interface:ManagedConfigurationItemService
Determine if the specifiedApplicationUser
would have permission to edit anManagedConfigurationItem
with the specified level.- Specified by:
doesUserHavePermission
in interfaceManagedConfigurationItemService
- Parameters:
user
- the userconfigurationItemAccessLevel
- the level- Returns:
- the result
-