com.atlassian.jira.issue.fields.layout.field
Class FieldLayoutSchemeImpl

java.lang.Object
  extended by com.atlassian.jira.issue.fields.screen.AbstractGVBean
      extended by com.atlassian.jira.issue.fields.layout.field.FieldLayoutSchemeImpl
All Implemented Interfaces:
FieldLayoutScheme

public class FieldLayoutSchemeImpl
extends AbstractGVBean
implements FieldLayoutScheme

Thread safety is mostly achieved (there are still some issues with the AbstractGVBean.setGenericValue(GenericValue) method) by two mechanisms.

  1. all mutative operations to the map are done under a write-lock. For extra safety all stores/loads from the database are also done under the lock, even though this is not ideal.
  2. iteration over the map are protected by a read-lock.


    Constructor Summary
    FieldLayoutSchemeImpl(FieldLayoutManager fieldLayoutManager, org.ofbiz.core.entity.GenericValue genericValue)
               
     
    Method Summary
     void addEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
               
     boolean containsEntity(String issueTypeId)
               
     String getDescription()
               
     Collection getEntities()
               
     FieldLayoutSchemeEntity getEntity(EditableFieldLayout editableFieldLayout)
               
     FieldLayoutSchemeEntity getEntity(String issueTypeId)
               
     Long getFieldLayoutId(String issueTypeId)
              Returns the id of the field layout to use for this given issue type id.
     Long getId()
               
    protected  Map getInternalSchemeEntities()
               
     String getName()
               
     Collection getProjects()
               
    protected  void init()
               
     void remove()
               
     void removeEntity(String issueTypeId)
               
     void setDescription(String description)
               
     void setName(String name)
               
     void store()
               
     
    Methods inherited from class com.atlassian.jira.issue.fields.screen.AbstractGVBean
    getGenericValue, isModified, setGenericValue, setModified, updateGV, valuesEqual
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface com.atlassian.jira.issue.fields.layout.field.FieldLayoutScheme
    getGenericValue, setGenericValue
     

    Constructor Detail

    FieldLayoutSchemeImpl

    public FieldLayoutSchemeImpl(FieldLayoutManager fieldLayoutManager,
                                 org.ofbiz.core.entity.GenericValue genericValue)
    Method Detail

    init

    protected void init()
    Specified by:
    init in class AbstractGVBean

    getId

    public Long getId()
    Specified by:
    getId in interface FieldLayoutScheme

    getName

    public String getName()
    Specified by:
    getName in interface FieldLayoutScheme

    setName

    public void setName(String name)
    Specified by:
    setName in interface FieldLayoutScheme

    getDescription

    public String getDescription()
    Specified by:
    getDescription in interface FieldLayoutScheme

    setDescription

    public void setDescription(String description)
    Specified by:
    setDescription in interface FieldLayoutScheme

    store

    public void store()
    Specified by:
    store in interface FieldLayoutScheme

    getFieldLayoutId

    public Long getFieldLayoutId(String issueTypeId)
    Description copied from interface: FieldLayoutScheme
    Returns the id of the field layout to use for this given issue type id. This will do all the necessary work to lookup the default entry if no specific mapping for the given isuse type id exists. So after calling this method simply use the returned field layout id.

    Specified by:
    getFieldLayoutId in interface FieldLayoutScheme

    getEntity

    public FieldLayoutSchemeEntity getEntity(String issueTypeId)
    Specified by:
    getEntity in interface FieldLayoutScheme

    getEntity

    public FieldLayoutSchemeEntity getEntity(EditableFieldLayout editableFieldLayout)
    Specified by:
    getEntity in interface FieldLayoutScheme

    getProjects

    public Collection getProjects()
    Specified by:
    getProjects in interface FieldLayoutScheme

    containsEntity

    public boolean containsEntity(String issueTypeId)
    Specified by:
    containsEntity in interface FieldLayoutScheme

    getInternalSchemeEntities

    protected Map getInternalSchemeEntities()

    addEntity

    public void addEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
    Specified by:
    addEntity in interface FieldLayoutScheme

    removeEntity

    public void removeEntity(String issueTypeId)
    Specified by:
    removeEntity in interface FieldLayoutScheme

    getEntities

    public Collection getEntities()
    Specified by:
    getEntities in interface FieldLayoutScheme

    remove

    public void remove()
    Specified by:
    remove in interface FieldLayoutScheme


    Copyright © 2002-2009 Atlassian. All Rights Reserved.