public class FieldConfigSchemeManagerImpl extends Object implements FieldConfigSchemeManager
ALL_ISSUE_TYPES
Constructor and Description |
---|
FieldConfigSchemeManagerImpl(FieldConfigSchemePersister configSchemePersister,
FieldConfigContextPersister contextPersister,
FieldConfigManager configManager) |
Modifier and Type | Method and Description |
---|---|
FieldConfigScheme |
createDefaultScheme(ConfigurableField field,
List<JiraContextNode> contexts) |
FieldConfigScheme |
createDefaultScheme(ConfigurableField field,
List<JiraContextNode> contexts,
List<IssueType> issueTypes) |
FieldConfigScheme |
createFieldConfigScheme(FieldConfigScheme newConfigScheme,
List<JiraContextNode> contexts,
List<IssueType> issueTypes,
ConfigurableField field) |
List<Project> |
getAssociatedProjectObjects(ConfigurableField field)
Returns a non-null list of Projects associated with the given field.
|
FieldConfigScheme |
getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
Retrieves the
FieldConfigScheme associated with the
FieldConfig |
List<FieldConfigScheme> |
getConfigSchemesForField(ConfigurableField field) |
FieldConfigScheme |
getFieldConfigScheme(Long configSchemeId) |
Collection |
getInvalidFieldConfigSchemesForIssueTypeRemoval(IssueType issueType)
Returns a collection of
FieldConfigScheme s for all Configuration
Contexts that will become invalid after the issuetype has been removed. |
FieldConfig |
getRelevantConfig(IssueContext issueContext,
ConfigurableField field)
Returns the relevant field config of this custom field for the give issue context
|
FieldConfigScheme |
getRelevantConfigScheme(IssueContext issueContext,
ConfigurableField field)
Returns the FieldConfigScheme for the given Project and ConfigurableField.
|
FieldConfigScheme |
getRelevantConfigScheme(Project project,
ConfigurableField field)
Returns the FieldConfigScheme for the given Project and ConfigurableField.
|
void |
init() |
boolean |
isRelevantForIssueContext(IssueContext issueContext,
ConfigurableField field)
Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.
|
void |
removeFieldConfigScheme(Long fieldConfigSchemeId)
Removes a field config scheme, as well as its associated contexts and field configs
(which includes option sets and generic configs)
|
void |
removeInvalidFieldConfigSchemesForCustomField(String customFieldId)
Given a CustomField, this method will correctly remove the fieldConfigSchemes if necessary.
|
void |
removeInvalidFieldConfigSchemesForIssueType(IssueType issueType)
Given an issueType, this method will correctly remove the fieldConfigSchemes if necessary.
|
void |
removeSchemeAssociation(List<JiraContextNode> contexts,
ConfigurableField configurableField) |
FieldConfigScheme |
updateFieldConfigScheme(FieldConfigScheme scheme)
Only update the name & description of a field
|
FieldConfigScheme |
updateFieldConfigScheme(FieldConfigScheme newScheme,
List<JiraContextNode> contexts,
ConfigurableField field)
Updates the config schemes with the new contexts
|
public FieldConfigSchemeManagerImpl(FieldConfigSchemePersister configSchemePersister, FieldConfigContextPersister contextPersister, FieldConfigManager configManager)
public void init()
init
in interface FieldConfigSchemeManager
public List<FieldConfigScheme> getConfigSchemesForField(ConfigurableField field)
getConfigSchemesForField
in interface FieldConfigSchemeManager
public FieldConfigScheme getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
FieldConfigSchemeManager
FieldConfigScheme
associated with the
FieldConfig
getConfigSchemeForFieldConfig
in interface FieldConfigSchemeManager
fieldConfig
- the field config to retrieve the FieldConfigScheme
of; cannot be null.FieldConfig
. Null if the config scheme can not be found.public FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
getFieldConfigScheme
in interface FieldConfigSchemeManager
public FieldConfigScheme createFieldConfigScheme(FieldConfigScheme newConfigScheme, List<JiraContextNode> contexts, List<IssueType> issueTypes, ConfigurableField field)
createFieldConfigScheme
in interface FieldConfigSchemeManager
public FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts, List<IssueType> issueTypes)
createDefaultScheme
in interface FieldConfigSchemeManager
public FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts)
createDefaultScheme
in interface FieldConfigSchemeManager
public void removeSchemeAssociation(List<JiraContextNode> contexts, ConfigurableField configurableField)
removeSchemeAssociation
in interface FieldConfigSchemeManager
public List<Project> getAssociatedProjectObjects(ConfigurableField field)
FieldConfigSchemeManager
getAssociatedProjectObjects
in interface FieldConfigSchemeManager
field
- the Fieldpublic FieldConfigScheme updateFieldConfigScheme(FieldConfigScheme newScheme, List<JiraContextNode> contexts, ConfigurableField field)
FieldConfigSchemeManager
updateFieldConfigScheme
in interface FieldConfigSchemeManager
public FieldConfigScheme updateFieldConfigScheme(FieldConfigScheme scheme)
FieldConfigSchemeManager
updateFieldConfigScheme
in interface FieldConfigSchemeManager
scheme
- scheme with the name & description to be updatedpublic void removeFieldConfigScheme(Long fieldConfigSchemeId)
FieldConfigSchemeManager
removeFieldConfigScheme
in interface FieldConfigSchemeManager
fieldConfigSchemeId
- the id of the field config scheme to removepublic void removeInvalidFieldConfigSchemesForIssueType(IssueType issueType)
FieldConfigSchemeManager
removeInvalidFieldConfigSchemesForIssueType
in interface FieldConfigSchemeManager
issueType
- The IssueType being deletedpublic void removeInvalidFieldConfigSchemesForCustomField(String customFieldId)
FieldConfigSchemeManager
removeInvalidFieldConfigSchemesForCustomField
in interface FieldConfigSchemeManager
customFieldId
- The id of the CustomField being deletedpublic Collection getInvalidFieldConfigSchemesForIssueTypeRemoval(IssueType issueType)
FieldConfigSchemeManager
FieldConfigScheme
s for all Configuration
Contexts that will become invalid after the issuetype has been removed. That is the configuration contexts that
will no longer be linked to ANY issue types after the issue type passed is has been deleted.getInvalidFieldConfigSchemesForIssueTypeRemoval
in interface FieldConfigSchemeManager
issueType
- The issueType to be deletedFieldConfigScheme
spublic boolean isRelevantForIssueContext(IssueContext issueContext, ConfigurableField field)
FieldConfigSchemeManager
This is equivalent to calling
getRelevantConfig(issueContext, field) != nullbut in general can run faster because it does not have to resolve the actual FieldConfig.
isRelevantForIssueContext
in interface FieldConfigSchemeManager
issueContext
- IssueContext whose project and issue type will be used to check if the field has a configFieldConfigSchemeManager.getRelevantConfig(com.atlassian.jira.issue.context.IssueContext, com.atlassian.jira.issue.fields.ConfigurableField)
public FieldConfig getRelevantConfig(IssueContext issueContext, ConfigurableField field)
FieldConfigSchemeManager
getRelevantConfig
in interface FieldConfigSchemeManager
issueContext
- issue context to find the relevant field config forFieldConfigSchemeManager.isRelevantForIssueContext(com.atlassian.jira.issue.context.IssueContext, com.atlassian.jira.issue.fields.ConfigurableField)
@Nullable public FieldConfigScheme getRelevantConfigScheme(IssueContext issueContext, ConfigurableField field)
FieldConfigSchemeManager
getRelevantConfigScheme
in interface FieldConfigSchemeManager
issueContext
- actually we ignore the Issue Type and just use the Project.field
- the ConfigurableField@Nullable public FieldConfigScheme getRelevantConfigScheme(Project project, ConfigurableField field)
FieldConfigSchemeManager
getRelevantConfigScheme
in interface FieldConfigSchemeManager
project
- the Project.field
- the ConfigurableFieldCopyright © 2002-2017 Atlassian. All Rights Reserved.