com.atlassian.bandana
Class DefaultBandanaManager

java.lang.Object
  extended by com.atlassian.bandana.DefaultBandanaManager
All Implemented Interfaces:
BandanaManager

public class DefaultBandanaManager
extends Object
implements BandanaManager


Constructor Summary
DefaultBandanaManager(BandanaPersister persister)
           
 
Method Summary
 String exportValues(BandanaContext context)
          Get all the values stored in bandana for this context.
 Object getValue(BandanaContext context, String key)
          Get the configuration object, starting with the given context and looking upwards.
 Object getValue(BandanaContext context, String key, boolean lookup)
          Get the configuration object, starting with the given context
 void importValues(BandanaContext context, String xmlValues)
          Replace all the values stored in bandana for this context with values read from the XML string supplied, which is guaranteed to have been produced by exportValues().
 void init()
          Initialise the bandana manager.
 void setValue(BandanaContext context, String key, Object value)
          Set a configuration object with the given context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBandanaManager

public DefaultBandanaManager(BandanaPersister persister)
Method Detail

init

public void init()
Description copied from interface: BandanaManager
Initialise the bandana manager. This must be called before anything else.

Specified by:
init in interface BandanaManager

getValue

public Object getValue(BandanaContext context,
                       String key)
Description copied from interface: BandanaManager
Get the configuration object, starting with the given context and looking upwards.

Specified by:
getValue in interface BandanaManager
Parameters:
context - The context to start looking in
key - The key of the BandanaConfigurationObject object
Returns:
Object object for this key, or null if none exists.

getValue

public Object getValue(BandanaContext context,
                       String key,
                       boolean lookup)
Description copied from interface: BandanaManager
Get the configuration object, starting with the given context

Specified by:
getValue in interface BandanaManager
Parameters:
context - The context to start looking in
key - The key of the BandanaConfigurationObject object
lookup - Whether or not to look up the context hierarchy if no context is found
Returns:
Object object for this key, or null if none exists.

exportValues

public String exportValues(BandanaContext context)
Description copied from interface: BandanaManager
Get all the values stored in bandana for this context. Note that this doesn't look up parent contexts. The values are exported as an XML string understood by importValues().

Specified by:
exportValues in interface BandanaManager

importValues

public void importValues(BandanaContext context,
                         String xmlValues)
Description copied from interface: BandanaManager
Replace all the values stored in bandana for this context with values read from the XML string supplied, which is guaranteed to have been produced by exportValues().

Specified by:
importValues in interface BandanaManager

setValue

public void setValue(BandanaContext context,
                     String key,
                     Object value)
Description copied from interface: BandanaManager
Set a configuration object with the given context.

Specified by:
setValue in interface BandanaManager
Parameters:
context - The context to store this value in
key - The key of the object
value - The value to be stored


Atlassian Bandana is developed by Atlassian Software Systems.