Class FieldConfigSchemeManagerImpl
java.lang.Object
com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl
- All Implemented Interfaces:
FieldConfigSchemeManager
-
Field Summary
Fields inherited from interface com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManager
ALL_ISSUE_TYPES -
Constructor Summary
ConstructorsConstructorDescriptionFieldConfigSchemeManagerImpl(FieldConfigSchemePersister configSchemePersister, FieldConfigContextPersister contextPersister, FieldConfigManager configManager, CustomFieldContextHandler customFieldContextHandler, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionaddAssociatedContexts(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeAdded, ConfigurableField field) Adds new contexts to a config schemecreateDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts) createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts, List<IssueType> issueTypes) createFieldConfigScheme(FieldConfigScheme newConfigScheme, List<JiraContextNode> contexts, List<IssueType> issueTypes, ConfigurableField field) Returns a non-null list of Projects associated with the given field.getConfigSchemeForFieldConfig(FieldConfig fieldConfig) Retrieves theFieldConfigSchemeassociated with theFieldConfiggetFieldConfigScheme(Long configSchemeId) Returns a collection ofFieldConfigSchemes for all Configuration Contexts that will become invalid after the issuetype has been removed.getRelevantConfig(IssueContext issueContext, ConfigurableField field) Returns the relevant field config of this custom field for the give issue contextgetRelevantConfigScheme(IssueContext issueContext, ConfigurableField field) Returns the FieldConfigScheme for the given Project and ConfigurableField.getRelevantConfigScheme(Project project, ConfigurableField field) Returns the FieldConfigScheme for the given Project and ConfigurableField.voidinit()booleanisRelevantForIssueContext(IssueContext issueContext, ConfigurableField field) Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.removeAssociatedContexts(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeRemoved, ConfigurableField field) Removes contexts from a config schemevoidremoveFieldConfigScheme(Long fieldConfigSchemeId) Removes a field config scheme, as well as its associated contexts and field configs (which includes option sets and generic configs)voidremoveInvalidFieldConfigSchemesForCustomField(String customFieldId) Given a CustomField, this method will correctly remove the fieldConfigSchemes if necessary.voidGiven an issueType, this method will correctly remove the fieldConfigSchemes if necessary.voidremoveSchemeAssociation(List<JiraContextNode> contexts, ConfigurableField configurableField) Only update the name invalid input: '&' description of a fieldupdateFieldConfigScheme(FieldConfigScheme scheme, List<JiraContextNode> contexts, ConfigurableField field) Updates the config schemes with the new contexts
-
Constructor Details
-
FieldConfigSchemeManagerImpl
public FieldConfigSchemeManagerImpl(FieldConfigSchemePersister configSchemePersister, FieldConfigContextPersister contextPersister, FieldConfigManager configManager, CustomFieldContextHandler customFieldContextHandler, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
init
public void init()- Specified by:
initin interfaceFieldConfigSchemeManager
-
getConfigSchemesForField
- Specified by:
getConfigSchemesForFieldin interfaceFieldConfigSchemeManager
-
getConfigSchemeForFieldConfig
Description copied from interface:FieldConfigSchemeManagerRetrieves theFieldConfigSchemeassociated with theFieldConfig- Specified by:
getConfigSchemeForFieldConfigin interfaceFieldConfigSchemeManager- Parameters:
fieldConfig- the field config to retrieve theFieldConfigSchemeof; cannot be null.- Returns:
- the config scheme for the
FieldConfig. Null if the config scheme can not be found.
-
getFieldConfigScheme
- Specified by:
getFieldConfigSchemein interfaceFieldConfigSchemeManager
-
createFieldConfigScheme
public FieldConfigScheme createFieldConfigScheme(FieldConfigScheme newConfigScheme, List<JiraContextNode> contexts, List<IssueType> issueTypes, ConfigurableField field) - Specified by:
createFieldConfigSchemein interfaceFieldConfigSchemeManager
-
createDefaultScheme
public FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts, List<IssueType> issueTypes) - Specified by:
createDefaultSchemein interfaceFieldConfigSchemeManager
-
createDefaultScheme
public FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts) - Specified by:
createDefaultSchemein interfaceFieldConfigSchemeManager
-
removeSchemeAssociation
public void removeSchemeAssociation(List<JiraContextNode> contexts, ConfigurableField configurableField) - Specified by:
removeSchemeAssociationin interfaceFieldConfigSchemeManager
-
getAssociatedProjectObjects
Description copied from interface:FieldConfigSchemeManagerReturns a non-null list of Projects associated with the given field.- Specified by:
getAssociatedProjectObjectsin interfaceFieldConfigSchemeManager- Parameters:
field- the Field- Returns:
- a non-null list of Projects associated with the given field.
-
updateFieldConfigScheme
public FieldConfigScheme updateFieldConfigScheme(FieldConfigScheme scheme, List<JiraContextNode> contexts, ConfigurableField field) Description copied from interface:FieldConfigSchemeManagerUpdates the config schemes with the new contexts- Specified by:
updateFieldConfigSchemein interfaceFieldConfigSchemeManager- Parameters:
scheme-contexts-field-- Returns:
- The updated scheme
-
addAssociatedContexts
public FieldConfigScheme addAssociatedContexts(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeAdded, ConfigurableField field) Description copied from interface:FieldConfigSchemeManagerAdds new contexts to a config scheme- Specified by:
addAssociatedContextsin interfaceFieldConfigSchemeManager- Parameters:
scheme-contextsToBeAdded-field-- Returns:
- The updated scheme
-
removeAssociatedContexts
public FieldConfigScheme removeAssociatedContexts(FieldConfigScheme scheme, Set<JiraContextNode> contextsToBeRemoved, ConfigurableField field) Description copied from interface:FieldConfigSchemeManagerRemoves contexts from a config scheme- Specified by:
removeAssociatedContextsin interfaceFieldConfigSchemeManager- Parameters:
scheme-contextsToBeRemoved-field-- Returns:
- The updated scheme
-
updateFieldConfigScheme
Description copied from interface:FieldConfigSchemeManagerOnly update the name invalid input: '&' description of a field- Specified by:
updateFieldConfigSchemein interfaceFieldConfigSchemeManager- Parameters:
scheme- scheme with the name & description to be updated- Returns:
- the updated scheme
-
removeFieldConfigScheme
Description copied from interface:FieldConfigSchemeManagerRemoves a field config scheme, as well as its associated contexts and field configs (which includes option sets and generic configs)- Specified by:
removeFieldConfigSchemein interfaceFieldConfigSchemeManager- Parameters:
fieldConfigSchemeId- the id of the field config scheme to remove
-
removeInvalidFieldConfigSchemesForIssueType
Description copied from interface:FieldConfigSchemeManagerGiven an issueType, this method will correctly remove the fieldConfigSchemes if necessary. In other words if a FieldConfigScheme is linked to only a single issueType, and we're deleting that issuetype then that FieldConfigScheme will be deleted. If a FieldConfigScheme is associated with multiple issueTypes, then only the association for the issueType we're deleting will be removed, but the FieldConfigScheme will remain.- Specified by:
removeInvalidFieldConfigSchemesForIssueTypein interfaceFieldConfigSchemeManager- Parameters:
issueType- The IssueType being deleted
-
removeInvalidFieldConfigSchemesForCustomField
Description copied from interface:FieldConfigSchemeManagerGiven a CustomField, this method will correctly remove the fieldConfigSchemes if necessary. In other words if a FieldConfigScheme is linked to only a single CustomField, and we're deleting that field then that FieldConfigScheme will be deleted. If a FieldConfigScheme is associated with multiple fields, then only the association for the field we're deleting will be removed, but the FieldConfigScheme will remain.- Specified by:
removeInvalidFieldConfigSchemesForCustomFieldin interfaceFieldConfigSchemeManager- Parameters:
customFieldId- The id of the CustomField being deleted
-
getInvalidFieldConfigSchemesForIssueTypeRemoval
Description copied from interface:FieldConfigSchemeManagerReturns a collection ofFieldConfigSchemes 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.- Specified by:
getInvalidFieldConfigSchemesForIssueTypeRemovalin interfaceFieldConfigSchemeManager- Parameters:
issueType- The issueType to be deleted- Returns:
- A collection of
FieldConfigSchemes
-
isRelevantForIssueContext
Description copied from interface:FieldConfigSchemeManagerReturns true if the custom field has a config for the Project and Issue Type of the given IssueContext.This is equivalent to calling
getRelevantConfig(issueContext, field) != null
but in general can run faster because it does not have to resolve the actual FieldConfig.- Specified by:
isRelevantForIssueContextin interfaceFieldConfigSchemeManager- Parameters:
issueContext- IssueContext whose project and issue type will be used to check if the field has a config- Returns:
- true if the custom field has a config for the Project and Issue Type of the given IssueContext.
- See Also:
-
getRelevantConfig
Description copied from interface:FieldConfigSchemeManagerReturns the relevant field config of this custom field for the give issue context- Specified by:
getRelevantConfigin interfaceFieldConfigSchemeManager- Parameters:
issueContext- issue context to find the relevant field config for- Returns:
- the relevant field config of this custom field for the give issue context
- See Also:
-
getRelevantConfigScheme
@Nullable public FieldConfigScheme getRelevantConfigScheme(IssueContext issueContext, ConfigurableField field) Description copied from interface:FieldConfigSchemeManagerReturns the FieldConfigScheme for the given Project and ConfigurableField.- Specified by:
getRelevantConfigSchemein interfaceFieldConfigSchemeManager- Parameters:
issueContext- actually we ignore the Issue Type and just use the Project.field- the ConfigurableField- Returns:
- the FieldConfigScheme for the given Project and ConfigurableField.
-
getRelevantConfigScheme
@Nullable public FieldConfigScheme getRelevantConfigScheme(Project project, ConfigurableField field) Description copied from interface:FieldConfigSchemeManagerReturns the FieldConfigScheme for the given Project and ConfigurableField.- Specified by:
getRelevantConfigSchemein interfaceFieldConfigSchemeManager- Parameters:
project- the Project.field- the ConfigurableField- Returns:
- the FieldConfigScheme for the given Project and ConfigurableField.
-