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, Named, NamedWithDescription, NamedWithId

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)
               
    protected  void cacheEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
               
     boolean containsEntity(String issueTypeId)
               
    protected  void flushEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)
               
     String getDescription()
               
     Collection<FieldLayoutSchemeEntity> 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()
               
     String getName()
               
     Collection<org.ofbiz.core.entity.GenericValue> 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
     
    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
    Specified by:
    getId in interface NamedWithId

    getName

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

    setName

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

    getDescription

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

    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
    Parameters:
    issueTypeId - the Issue Type ID.
    Returns:
    the id of the FieldLayout ("Field Configuration") to use for this given issue type id.

    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<org.ofbiz.core.entity.GenericValue> getProjects()
    Specified by:
    getProjects in interface FieldLayoutScheme

    containsEntity

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

    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<FieldLayoutSchemeEntity> getEntities()
    Specified by:
    getEntities in interface FieldLayoutScheme

    remove

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

    cacheEntity

    protected void cacheEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)

    flushEntity

    protected void flushEntity(FieldLayoutSchemeEntity fieldLayoutSchemeEntity)


    Copyright © 2002-2014 Atlassian. All Rights Reserved.