org.naftulin.configmgr.content
Class DbJndiRecordImpl

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

public class DbJndiRecordImpl
extends AbstractRecordImpl

Represents a db jndi 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:

        <dbjndi key="the key"
                initialContextFactory="optional contenxt factory" 
                jndiName="jdni name"            
                sql="sql that selects at least key and value columns from any table(s) or view with any static where condition"
                keyColumnName="column name where the key is selected"
                valueColumnName="column name where the value is selected"
 
 >
                <param name="key1" value="value1" />
                .....
                <param name="keyn" value="valuen" />
        </dbjndi>
 

Since:
1.3
Author:
Henry Henry

Constructor Summary
DbJndiRecordImpl()
           
 
Method Summary
 void addNameValuePair(NameValuePairImpl nv)
          Adds a name-value pair as it is read from the master configuration.
 java.lang.String getFileName()
          Returns the file name associated with the record.
 java.lang.String getInitialContextFactory()
           
 java.lang.String getJndiName()
           
 java.lang.String getKeyColumnName()
           
 java.util.List<NameValuePairImpl> getNameValuePairs()
           
 ConfigEntryParser getParser()
          Returns the parser that can parse the file to extract the configuration.
 java.lang.String getSql()
           
 java.lang.String getValueColumnName()
           
 boolean isGetUrlForFile()
          Since it is not a file-based cofiguration, we need to overwrite the method.
 void setInitialContextFactory(java.lang.String initialContextFactory)
           
 void setJndiName(java.lang.String jndiName)
           
 void setKeyColumnName(java.lang.String keyColumnName)
           
 void setSql(java.lang.String sql)
           
 void setValueColumnName(java.lang.String valueColumnName)
           
 
Methods inherited from class org.naftulin.configmgr.content.AbstractRecordImpl
getKey, setFileName, setKey, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbJndiRecordImpl

public DbJndiRecordImpl()
Method Detail

getKeyColumnName

public java.lang.String getKeyColumnName()

setKeyColumnName

public void setKeyColumnName(java.lang.String keyColumnName)

getNameValuePairs

public java.util.List<NameValuePairImpl> getNameValuePairs()

addNameValuePair

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

Parameters:
nv - the name value pair.

getInitialContextFactory

public java.lang.String getInitialContextFactory()

setInitialContextFactory

public void setInitialContextFactory(java.lang.String initialContextFactory)

getJndiName

public java.lang.String getJndiName()

setJndiName

public void setJndiName(java.lang.String jndiName)

getSql

public java.lang.String getSql()

setSql

public void setSql(java.lang.String sql)

getValueColumnName

public java.lang.String getValueColumnName()

setValueColumnName

public void setValueColumnName(java.lang.String valueColumnName)

getParser

public ConfigEntryParser getParser()
                            throws ConfigurationManagerException
Description copied from class: AbstractRecordImpl
Returns the 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.

isGetUrlForFile

public boolean isGetUrlForFile()
Since it is not a file-based cofiguration, we need to overwrite the method.

Overrides:
isGetUrlForFile in class AbstractRecordImpl
Returns:
false

getFileName

public java.lang.String getFileName()
Description copied from class: AbstractRecordImpl
Returns the file name associated with the record.

Overrides:
getFileName in class AbstractRecordImpl
Returns:
the file name associated with the record.


Copyright © 2009. All Rights Reserved.