com.atlassian.jira.issue.fields.config.manager
Class FieldConfigSchemeManagerImpl

java.lang.Object
  extended by com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManagerImpl
All Implemented Interfaces:
FieldConfigSchemeManager

public class FieldConfigSchemeManagerImpl
extends Object
implements FieldConfigSchemeManager


Field Summary
 
Fields inherited from interface com.atlassian.jira.issue.fields.config.manager.FieldConfigSchemeManager
ALL_ISSUE_TYPES
 
Constructor Summary
FieldConfigSchemeManagerImpl(FieldConfigSchemePersister configSchemePersister, FieldConfigContextPersister contextPersister, JiraContextTreeManager treeManager, FieldConfigManager configManager)
           
 
Method Summary
 FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts)
           
 FieldConfigScheme createDefaultScheme(ConfigurableField field, List<JiraContextNode> contexts, List<org.ofbiz.core.entity.GenericValue> issueTypes)
           
 FieldConfigScheme createFieldConfigScheme(FieldConfigScheme newConfigScheme, List<JiraContextNode> contexts, List<org.ofbiz.core.entity.GenericValue> issueTypes, ConfigurableField field)
           
 List<Project> getAssociatedProjectObjects(ConfigurableField field)
          Returns a non-null list of Projects associated with the given field.
 List<org.ofbiz.core.entity.GenericValue> getAssociatedProjects(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 FieldConfigSchemes for all Configuration Contexts that will become invalid after the issuetype has been removed.
 FieldConfig getRelevantConfig(IssueContext issueContext, ConfigurableField field)
           
 FieldConfigScheme getRelevantConfigScheme(IssueContext issueContext, ConfigurableField field)
           
 Object getValue(com.atlassian.bandana.BandanaContext context, String key)
           
 Object getValue(com.atlassian.bandana.BandanaContext context, String key, boolean lookUp)
           
 void init()
           
 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)
           
 void setValue(com.atlassian.bandana.BandanaContext context, String key, Object value)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldConfigSchemeManagerImpl

public FieldConfigSchemeManagerImpl(FieldConfigSchemePersister configSchemePersister,
                                    FieldConfigContextPersister contextPersister,
                                    JiraContextTreeManager treeManager,
                                    FieldConfigManager configManager)
Method Detail

init

public void init()
Specified by:
init in interface FieldConfigSchemeManager

getValue

public Object getValue(com.atlassian.bandana.BandanaContext context,
                       String key)
Specified by:
getValue in interface FieldConfigSchemeManager

getValue

public Object getValue(com.atlassian.bandana.BandanaContext context,
                       String key,
                       boolean lookUp)
Specified by:
getValue in interface FieldConfigSchemeManager

setValue

public void setValue(com.atlassian.bandana.BandanaContext context,
                     String key,
                     Object value)
Specified by:
setValue in interface FieldConfigSchemeManager

getConfigSchemesForField

public List<FieldConfigScheme> getConfigSchemesForField(ConfigurableField field)
Specified by:
getConfigSchemesForField in interface FieldConfigSchemeManager

getConfigSchemeForFieldConfig

public FieldConfigScheme getConfigSchemeForFieldConfig(FieldConfig fieldConfig)
Description copied from interface: FieldConfigSchemeManager
Retrieves the FieldConfigScheme associated with the FieldConfig

Specified by:
getConfigSchemeForFieldConfig in interface FieldConfigSchemeManager
Parameters:
fieldConfig - the field config to retrieve the FieldConfigScheme of; cannot be null.
Returns:
the config scheme for the FieldConfig. Null if the config scheme can not be found.

getFieldConfigScheme

public FieldConfigScheme getFieldConfigScheme(Long configSchemeId)
Specified by:
getFieldConfigScheme in interface FieldConfigSchemeManager

createFieldConfigScheme

public FieldConfigScheme createFieldConfigScheme(FieldConfigScheme newConfigScheme,
                                                 List<JiraContextNode> contexts,
                                                 List<org.ofbiz.core.entity.GenericValue> issueTypes,
                                                 ConfigurableField field)
Specified by:
createFieldConfigScheme in interface FieldConfigSchemeManager

createDefaultScheme

public FieldConfigScheme createDefaultScheme(ConfigurableField field,
                                             List<JiraContextNode> contexts,
                                             List<org.ofbiz.core.entity.GenericValue> issueTypes)
Specified by:
createDefaultScheme in interface FieldConfigSchemeManager

createDefaultScheme

public FieldConfigScheme createDefaultScheme(ConfigurableField field,
                                             List<JiraContextNode> contexts)
Specified by:
createDefaultScheme in interface FieldConfigSchemeManager

removeSchemeAssociation

public void removeSchemeAssociation(List<JiraContextNode> contexts,
                                    ConfigurableField configurableField)
Specified by:
removeSchemeAssociation in interface FieldConfigSchemeManager

getAssociatedProjects

public List<org.ofbiz.core.entity.GenericValue> getAssociatedProjects(ConfigurableField field)
Description copied from interface: FieldConfigSchemeManager
Returns a non-null list of Projects associated with the given field.

Specified by:
getAssociatedProjects in interface FieldConfigSchemeManager
Parameters:
field - the Field
Returns:
a non-null list of Projects associated with the given field.

getAssociatedProjectObjects

public List<Project> getAssociatedProjectObjects(ConfigurableField field)
Description copied from interface: FieldConfigSchemeManager
Returns a non-null list of Projects associated with the given field.

Specified by:
getAssociatedProjectObjects in interface FieldConfigSchemeManager
Parameters:
field - the Field
Returns:
a non-null list of Projects associated with the given field.

updateFieldConfigScheme

public FieldConfigScheme updateFieldConfigScheme(FieldConfigScheme newScheme,
                                                 List<JiraContextNode> contexts,
                                                 ConfigurableField field)
Description copied from interface: FieldConfigSchemeManager
Updates the config schemes with the new contexts

Specified by:
updateFieldConfigScheme in interface FieldConfigSchemeManager
Returns:
The updated scheme

updateFieldConfigScheme

public FieldConfigScheme updateFieldConfigScheme(FieldConfigScheme scheme)
Description copied from interface: FieldConfigSchemeManager
Only update the name & description of a field

Specified by:
updateFieldConfigScheme in interface FieldConfigSchemeManager
Parameters:
scheme - scheme with the name & description to be updated
Returns:
the updated scheme

removeFieldConfigScheme

public void removeFieldConfigScheme(Long fieldConfigSchemeId)
Description copied from interface: FieldConfigSchemeManager
Removes a field config scheme, as well as its associated contexts and field configs (which includes option sets and generic configs)

Specified by:
removeFieldConfigScheme in interface FieldConfigSchemeManager
Parameters:
fieldConfigSchemeId - the id of the field config scheme to remove

removeInvalidFieldConfigSchemesForIssueType

public void removeInvalidFieldConfigSchemesForIssueType(IssueType issueType)
Description copied from interface: FieldConfigSchemeManager
Given 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:
removeInvalidFieldConfigSchemesForIssueType in interface FieldConfigSchemeManager
Parameters:
issueType - The IssueType being deleted

removeInvalidFieldConfigSchemesForCustomField

public void removeInvalidFieldConfigSchemesForCustomField(String customFieldId)
Description copied from interface: FieldConfigSchemeManager
Given 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:
removeInvalidFieldConfigSchemesForCustomField in interface FieldConfigSchemeManager
Parameters:
customFieldId - The id of the CustomField being deleted

getInvalidFieldConfigSchemesForIssueTypeRemoval

public Collection getInvalidFieldConfigSchemesForIssueTypeRemoval(IssueType issueType)
Description copied from interface: FieldConfigSchemeManager
Returns a collection of FieldConfigSchemes 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:
getInvalidFieldConfigSchemesForIssueTypeRemoval in interface FieldConfigSchemeManager
Parameters:
issueType - The issueType to be deleted
Returns:
A collection of FieldConfigSchemes

getRelevantConfig

public FieldConfig getRelevantConfig(IssueContext issueContext,
                                     ConfigurableField field)
Specified by:
getRelevantConfig in interface FieldConfigSchemeManager

getRelevantConfigScheme

public FieldConfigScheme getRelevantConfigScheme(IssueContext issueContext,
                                                 ConfigurableField field)
Specified by:
getRelevantConfigScheme in interface FieldConfigSchemeManager


Copyright © 2002-2013 Atlassian. All Rights Reserved.