org.naftulin.configmgr.content
Class ExternalRecordImpl

java.lang.Object
  extended by org.naftulin.configmgr.content.AbstractRecordImpl
      extended by org.naftulin.configmgr.content.ExternalRecordImpl

public class ExternalRecordImpl
extends AbstractRecordImpl

Represents an external entry, with it's key, name-value pairs and parser class. Intended to mirror master configuration rules for external configuration. The external configuraton xml is:

        <external key="the key" configEntryAdatorClass="the fully qualified parser class">
                <param name="key1" value="value1" />
                .....
                <param name="keyn" value="valuen" />
        </external>
 
where configEntryParserClass is a class implementing ExternalRecordAdapter interface.

Since:
1.0
Author:
Henry Henry

Constructor Summary
ExternalRecordImpl()
           
 
Method Summary
 void addNameValuePair(NameValuePairImpl nameValuePair)
          Adds a name-value pair as it is read from the master configuration.
 ConfigEntryParser getParser()
          Returns an instance of parser that can parse the file to extract the configuration.
 void setConfigEntryAdaptorClass(java.lang.String adaptor)
          Sets the configuration entry adapter class.
 
Methods inherited from class org.naftulin.configmgr.content.AbstractRecordImpl
getFileName, getKey, isGetUrlForFile, setFileName, setKey, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalRecordImpl

public ExternalRecordImpl()
Method Detail

addNameValuePair

public void addNameValuePair(NameValuePairImpl nameValuePair)
Adds a name-value pair as it is read from the master configuration.

Parameters:
nameValuePair - the name value pair.

setConfigEntryAdaptorClass

public void setConfigEntryAdaptorClass(java.lang.String adaptor)
Sets the configuration entry adapter class. This class will handle adapting the loading and reloading of the configurations by calling load and reload methods on the original, exteral interface.

Parameters:
adaptor - the fully qualified name of the adaptor implementation class.

getParser

public ConfigEntryParser getParser()
                            throws ConfigurationManagerException
Returns an instance of parser that can parse the file to extract the configuration.

Specified by:
getParser in class AbstractRecordImpl
Returns:
the parser that can parse the file to extract the configuration.
Throws:
ConfigurationManagerException - if an error occured while instantiating the parser.


Copyright © 2009. All Rights Reserved.