com.monad.homerun.config
Interface ConfigService


public interface ConfigService

ConfigService is a service providing access to configuration data. Mostly, this is hierarchically structured, but flat property files may also be used.


Method Summary
 org.w3c.dom.Document getConfigDoc(java.lang.String relPath)
           
 org.w3c.dom.Document getConfigDocFromPath(java.lang.String path)
           
 ConfigContext getContext(org.w3c.dom.Document document, java.lang.String contextPath)
          Returns a context object for the passed document
 ConfigContext getContext(java.lang.String contextPath)
          Returns a context object for the indicated config path
 ConfigContext getContext(java.lang.String configPath, java.lang.String contextPath)
          Returns a context object for the indicated config path
 org.w3c.dom.Document getDocFromStream(java.io.InputStream in)
           
 ConfigContext getEmptyContext()
          Returns an empty context
 java.util.Properties getProperties(java.lang.String configPath)
           
 void reset()
          Clears any cached config data from service
 void saveConfig(org.w3c.dom.Document doc, java.lang.String fileName)
           
 void saveConfig(java.lang.String fileName)
           
 boolean saveConfigStream(java.io.InputStream in, java.lang.String fileName)
           
 void saveProperties(java.util.Properties props, java.lang.String configPath)
           
 void writeDocToStream(org.w3c.dom.Document doc, java.io.Writer out)
           
 

Method Detail

getContext

ConfigContext getContext(java.lang.String configPath,
                         java.lang.String contextPath)
                         throws java.io.IOException
Returns a context object for the indicated config path

Parameters:
configPath -
contextPath -
Returns:
an empty context if file does not exist, or context path invalid
Throws:
java.io.IOException

getEmptyContext

ConfigContext getEmptyContext()
Returns an empty context

Returns:
an empty context

getContext

ConfigContext getContext(java.lang.String contextPath)
                         throws java.io.IOException
Returns a context object for the indicated config path

Parameters:
contextPath -
Returns:
an empty context if file does not exist, or context path invalid
Throws:
java.io.IOException

getContext

ConfigContext getContext(org.w3c.dom.Document document,
                         java.lang.String contextPath)
Returns a context object for the passed document

Parameters:
document -
contextPath -
Returns:
empty context if document is null

saveConfig

void saveConfig(org.w3c.dom.Document doc,
                java.lang.String fileName)
                throws java.io.IOException
Throws:
java.io.IOException

getConfigDoc

org.w3c.dom.Document getConfigDoc(java.lang.String relPath)
                                  throws java.io.IOException
Throws:
java.io.IOException

getConfigDocFromPath

org.w3c.dom.Document getConfigDocFromPath(java.lang.String path)
                                          throws java.io.IOException
Throws:
java.io.IOException

saveConfig

void saveConfig(java.lang.String fileName)
                throws java.io.IOException
Throws:
java.io.IOException

getDocFromStream

org.w3c.dom.Document getDocFromStream(java.io.InputStream in)

saveConfigStream

boolean saveConfigStream(java.io.InputStream in,
                         java.lang.String fileName)
                         throws java.io.IOException
Throws:
java.io.IOException

writeDocToStream

void writeDocToStream(org.w3c.dom.Document doc,
                      java.io.Writer out)
                      throws java.io.IOException
Throws:
java.io.IOException

reset

void reset()
Clears any cached config data from service


getProperties

java.util.Properties getProperties(java.lang.String configPath)
                                   throws java.io.IOException
Throws:
java.io.IOException

saveProperties

void saveProperties(java.util.Properties props,
                    java.lang.String configPath)
                    throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.