public class

DefaultManagedConfigurationItemService

extends Object
implements ManagedConfigurationItemService
java.lang.Object
   ↳ com.atlassian.jira.config.managedconfiguration.DefaultManagedConfigurationItemService

Class Overview

The default implementation of ManagedConfigurationItemService.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.config.managedconfiguration.ManagedConfigurationItemService
Public Constructors
DefaultManagedConfigurationItemService(ManagedConfigurationItemStore managedConfigurationItemStore, PermissionManager permissionManager, PluginAccessor pluginAccessor)
Public Methods
boolean doesUserHavePermission(User user, ConfigurationItemAccessLevel configurationItemAccessLevel)
Determine if the specified User would have permission to edit an ManagedConfigurationItem with the specified level.
boolean doesUserHavePermission(User user, ManagedConfigurationItem item)
Determine if the specified User would have permission to edit the ManagedConfigurationItem.
@Nonnull Collection<ManagedConfigurationItem> getManagedConfigurationItems(ManagedConfigurationItemType type)
Retrieves all of the ManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).
@Nonnull ManagedConfigurationItem getManagedCustomField(CustomField customField)
Given the CustomField, attempt to retrieve the ManagedConfigurationItem that describes it.
@Nonnull ManagedConfigurationItem getManagedWorkflow(JiraWorkflow workflow)
Given the JiraWorkflow, attempt to retrieve the ManagedConfigurationItem that describes it.
@Nonnull ManagedConfigurationItem getManagedWorkflowScheme(Long schemeId)
Given the workflow scheme ID, attempt to retrieve the ManagedConfigurationItem that describes it.
@Nonnull ManagedConfigurationItem getManagedWorkflowScheme(WorkflowScheme workflowScheme)
Given the WorkflowScheme, attempt to retrieve the ManagedConfigurationItem that describes it.
@Nonnull ServiceOutcome<Void> removeManagedConfigurationItem(ManagedConfigurationItem item)
Remove the registration of this ManagedConfigurationItem.
@Nonnull ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem(ManagedConfigurationItem item)
Update the registration of this ManagedConfigurationItem.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.config.managedconfiguration.ManagedConfigurationItemService

Public Constructors

public DefaultManagedConfigurationItemService (ManagedConfigurationItemStore managedConfigurationItemStore, PermissionManager permissionManager, PluginAccessor pluginAccessor)

Public Methods

public boolean doesUserHavePermission (User user, ConfigurationItemAccessLevel configurationItemAccessLevel)

Determine if the specified User would have permission to edit an ManagedConfigurationItem with the specified level.

Parameters
user the user
configurationItemAccessLevel the level
Returns
  • the result

public boolean doesUserHavePermission (User user, ManagedConfigurationItem item)

Determine if the specified User would have permission to edit the ManagedConfigurationItem.

Parameters
user the user
item the item
Returns
  • the result

@Nonnull public Collection<ManagedConfigurationItem> getManagedConfigurationItems (ManagedConfigurationItemType type)

Retrieves all of the ManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).

Parameters
type the type to retrieve
Returns
  • the items

@Nonnull public ManagedConfigurationItem getManagedCustomField (CustomField customField)

Given the CustomField, attempt to retrieve the ManagedConfigurationItem 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.

Parameters
customField the custom field
Returns
  • the item's representation

@Nonnull public ManagedConfigurationItem getManagedWorkflow (JiraWorkflow workflow)

Given the JiraWorkflow, attempt to retrieve the ManagedConfigurationItem 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.

Parameters
workflow the workflow
Returns
  • the item's representation

@Nonnull public ManagedConfigurationItem getManagedWorkflowScheme (Long schemeId)

Given the workflow scheme ID, attempt to retrieve the ManagedConfigurationItem 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.

Parameters
schemeId the workflow scheme ID
Returns
  • the item's representation

@Nonnull public ManagedConfigurationItem getManagedWorkflowScheme (WorkflowScheme workflowScheme)

Given the WorkflowScheme, attempt to retrieve the ManagedConfigurationItem 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.

Parameters
workflowScheme the workflow scheme
Returns
  • the item's representation

@Nonnull public ServiceOutcome<Void> removeManagedConfigurationItem (ManagedConfigurationItem item)

Remove the registration of this ManagedConfigurationItem. If the item was not previously managed, an error will be returned.

Parameters
item the item to stop managing
Returns
  • the result; errors if saving the item failed

@Nonnull public ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem (ManagedConfigurationItem item)

Update the registration of this ManagedConfigurationItem. If the item was not previously managed, it will now be managed.

Parameters
item the item to manage
Returns
  • the result; errors if saving the item failed