org.naftulin.configmgr.content
Class AbstractRecordImpl

java.lang.Object
  extended by org.naftulin.configmgr.content.AbstractRecordImpl
Direct Known Subclasses:
DbDirectRecordImpl, DbJndiRecordImpl, ExternalRecordImpl, JndiRecordImpl, Log4JRecordImpl, MasterRecordImpl, PropertyRecordImpl, XmlRecordImpl

public abstract class AbstractRecordImpl
extends java.lang.Object

Abstract Record implementation combines the most common attributes of the record: file name and key. A record is described in the master configuraion: current implementations include property record, log4j xml or property and external record, all sub-classed from the abstract record.

Since:
1.0
Author:
Henry Naftulin

Constructor Summary
AbstractRecordImpl()
          Constructs a record without specifying the key or file name.
AbstractRecordImpl(java.lang.String key, java.lang.String fileName)
          Constructs a record with the key and file name specified.
 
Method Summary
 java.lang.String getFileName()
          Returns the file name associated with the record.
 java.lang.String getKey()
          Returns the key associated with the record.
abstract  ConfigEntryParser getParser()
          Returns the parser that can parse the file to extract the configuration.
 boolean isGetUrlForFile()
          If configuration is file-base, we need to get the file to be parsed.
 void setFileName(java.lang.String fileName)
          Sets the file name for the reoord.
 void setKey(java.lang.String key)
          Sets the key associated with the record.
 java.lang.String toString()
          Returns the string representation of the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRecordImpl

public AbstractRecordImpl()
Constructs a record without specifying the key or file name.


AbstractRecordImpl

public AbstractRecordImpl(java.lang.String key,
                          java.lang.String fileName)
Constructs a record with the key and file name specified.

Parameters:
key - the key associated with the record.
fileName - the file name associated with the record.
Method Detail

isGetUrlForFile

public boolean isGetUrlForFile()
If configuration is file-base, we need to get the file to be parsed. Most of the configurations are file-based.

Returns:
true.

getFileName

public java.lang.String getFileName()
Returns the file name associated with the record.

Returns:
the file name associated with the record.

setFileName

public void setFileName(java.lang.String fileName)
Sets the file name for the reoord.

Parameters:
fileName - the file name for the record.

getKey

public java.lang.String getKey()
Returns the key associated with the record.

Returns:
the key associated with the record.

setKey

public void setKey(java.lang.String key)
Sets the key associated with the record.

Parameters:
key - the key associated with the record.

getParser

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

Returns:
the parser that can parse the file to extract the configuration.
Throws:
ConfigurationManagerException - if an error occured while instantiating the parser.

toString

public java.lang.String toString()
Returns the string representation of the record.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the record.


Copyright © 2009. All Rights Reserved.