com.atlassian.jira.config.managedconfiguration
Class DefaultManagedConfigurationItemService

java.lang.Object
  extended by 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
DefaultManagedConfigurationItemService(ManagedConfigurationItemStore managedConfigurationItemStore, PermissionManager permissionManager, com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
 boolean doesUserHavePermission(com.atlassian.crowd.embedded.api.User user, ConfigurationItemAccessLevel configurationItemAccessLevel)
          Determine if the specified User would have permission to edit an ManagedConfigurationItem with the specified level.
 boolean doesUserHavePermission(com.atlassian.crowd.embedded.api.User user, ManagedConfigurationItem item)
          Determine if the specified User would have permission to edit the ManagedConfigurationItem.
 Collection<ManagedConfigurationItem> getManagedConfigurationItems(ManagedConfigurationItemType type)
          Retrieves all of the ManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).
 ManagedConfigurationItem getManagedCustomField(CustomField customField)
          Given the CustomField, attempt to retrieve the ManagedConfigurationItem that describes it.
 ManagedConfigurationItem getManagedWorkflow(JiraWorkflow workflow)
          Given the JiraWorkflow, attempt to retrieve the ManagedConfigurationItem that describes it.
 ManagedConfigurationItem getManagedWorkflowScheme(Long schemeId)
          Given the workflow scheme ID, attempt to retrieve the ManagedConfigurationItem that describes it.
 ManagedConfigurationItem getManagedWorkflowScheme(WorkflowScheme workflowScheme)
          Given the WorkflowScheme, attempt to retrieve the ManagedConfigurationItem that describes it.
 ServiceOutcome<Void> removeManagedConfigurationItem(ManagedConfigurationItem item)
          Remove the registration of this ManagedConfigurationItem.
 ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem(ManagedConfigurationItem item)
          Update the registration of this ManagedConfigurationItem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultManagedConfigurationItemService

public DefaultManagedConfigurationItemService(ManagedConfigurationItemStore managedConfigurationItemStore,
                                              PermissionManager permissionManager,
                                              com.atlassian.plugin.PluginAccessor pluginAccessor)
Method Detail

updateManagedConfigurationItem

@Nonnull
public ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem(@Nonnull
                                                                                       ManagedConfigurationItem item)
Description copied from interface: ManagedConfigurationItemService
Update the registration of this ManagedConfigurationItem. If the item was not previously managed, it will now be managed.

Specified by:
updateManagedConfigurationItem in interface ManagedConfigurationItemService
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 this ManagedConfigurationItem. If the item was not previously managed, an error will be returned.

Specified by:
removeManagedConfigurationItem in interface ManagedConfigurationItemService
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 the ManagedConfigurationItems of the specified type which are currently "available" (meaning their owner is currently available).

Specified by:
getManagedConfigurationItems in interface ManagedConfigurationItemService
Parameters:
type - the type to retrieve
Returns:
the items

getManagedCustomField

@Nonnull
public ManagedConfigurationItem getManagedCustomField(@Nonnull
                                                              CustomField customField)
Description copied from interface: ManagedConfigurationItemService
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.

Specified by:
getManagedCustomField in interface ManagedConfigurationItemService
Parameters:
customField - the custom field
Returns:
the item's representation

getManagedWorkflow

@Nonnull
public ManagedConfigurationItem getManagedWorkflow(@Nonnull
                                                           JiraWorkflow workflow)
Description copied from interface: ManagedConfigurationItemService
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.

Specified by:
getManagedWorkflow in interface ManagedConfigurationItemService
Parameters:
workflow - the workflow
Returns:
the item's representation

getManagedWorkflowScheme

@Nonnull
public ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull
                                                                 WorkflowScheme workflowScheme)
Description copied from interface: ManagedConfigurationItemService
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.

Specified by:
getManagedWorkflowScheme in interface ManagedConfigurationItemService
Parameters:
workflowScheme - the workflow scheme
Returns:
the item's representation
See Also:
ManagedConfigurationItemService.getManagedWorkflowScheme(Long)

getManagedWorkflowScheme

@Nonnull
public ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull
                                                                 Long schemeId)
Description copied from interface: ManagedConfigurationItemService
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.

Specified by:
getManagedWorkflowScheme in interface ManagedConfigurationItemService
Parameters:
schemeId - the workflow scheme ID
Returns:
the item's representation
See Also:
ManagedConfigurationItemService.getManagedWorkflowScheme(WorkflowScheme)

doesUserHavePermission

public boolean doesUserHavePermission(com.atlassian.crowd.embedded.api.User user,
                                      @Nonnull
                                      ManagedConfigurationItem item)
Description copied from interface: ManagedConfigurationItemService
Determine if the specified User would have permission to edit the ManagedConfigurationItem.

Specified by:
doesUserHavePermission in interface ManagedConfigurationItemService
Parameters:
user - the user
item - the item
Returns:
the result

doesUserHavePermission

public boolean doesUserHavePermission(com.atlassian.crowd.embedded.api.User user,
                                      @Nonnull
                                      ConfigurationItemAccessLevel configurationItemAccessLevel)
Description copied from interface: ManagedConfigurationItemService
Determine if the specified User would have permission to edit an ManagedConfigurationItem with the specified level.

Specified by:
doesUserHavePermission in interface ManagedConfigurationItemService
Parameters:
user - the user
configurationItemAccessLevel - the level
Returns:
the result


Copyright © 2002-2012 Atlassian. All Rights Reserved.