org.apache.lucene.store.jdbc
Class JdbcFileEntrySettings

java.lang.Object
  extended by org.apache.lucene.store.jdbc.JdbcFileEntrySettings

public class JdbcFileEntrySettings
extends Object

A file entry level settings. An abstract view of any type of setting that cab be used by the actual file entry handler that uses it.

Holds the FILE_ENTRY_HANDLER_TYPE that defines the type of the FileEntryHandler that will be created and initialized with the settings.

Default values for a new instanciated instnce are: MarkDeleteFileEntryHandler for the FILE_ENTRY_HANDLER_TYPE setting, FetchOnBufferReadJdbcIndexInput for the INDEX_INPUT_TYPE_SETTING setting, and RAMAndFileJdbcIndexOutput for the INDEX_OUTPUT_TYPE_SETTING setting.

Author:
kimchy

Field Summary
static String FILE_ENTRY_HANDLER_TYPE
          The class name of the FileEntryHandler.
static String INDEX_INPUT_TYPE_SETTING
          The class name of the IndexInput.
static String INDEX_OUTPUT_TYPE_SETTING
          The class name of the IndexOutput.
 
Constructor Summary
JdbcFileEntrySettings()
          Creates a new file entry settings, and intialize it to default values.
 
Method Summary
 Properties getProperties()
          Returns the inner java properties.
 String getSetting(String setting)
          Returns the value match for the given setting.
 String getSetting(String setting, String defaultValue)
          Returns the value that matches the given setting.
 boolean getSettingAsBoolean(String setting, boolean defaultValue)
          Returns the boolean value that matches the given setting.
 Class getSettingAsClass(String setting, Class defaultValue)
          Returns the class value that matches the given setting.
 Class getSettingAsClass(String setting, Class defaultValue, ClassLoader classLoader)
          Returns the class value that matches the given setting.
 float getSettingAsFloat(String setting, float defaultValue)
          Returns the float value that matches the given setting.
 int getSettingAsInt(String setting, int defaultValue)
          Returns the int value that matches the given setting.
 long getSettingAsLong(String setting, long defaultValue)
          Returns the long value that matches the given setting.
 JdbcFileEntrySettings setBooleanSetting(String setting, boolean value)
           
 JdbcFileEntrySettings setClassSetting(String setting, Class clazz)
           
 JdbcFileEntrySettings setFloatSetting(String setting, float value)
           
 JdbcFileEntrySettings setIntSetting(String setting, int value)
           
 JdbcFileEntrySettings setLongSetting(String setting, long value)
           
 JdbcFileEntrySettings setSetting(String setting, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEX_INPUT_TYPE_SETTING

public static final String INDEX_INPUT_TYPE_SETTING
The class name of the IndexInput. Only applies to FileEntryHandlers that use it.

See Also:
Constant Field Values

INDEX_OUTPUT_TYPE_SETTING

public static final String INDEX_OUTPUT_TYPE_SETTING
The class name of the IndexOutput. Only applies to FileEntryHandlers that use it.

See Also:
Constant Field Values

FILE_ENTRY_HANDLER_TYPE

public static final String FILE_ENTRY_HANDLER_TYPE
The class name of the FileEntryHandler.

See Also:
Constant Field Values
Constructor Detail

JdbcFileEntrySettings

public JdbcFileEntrySettings()
Creates a new file entry settings, and intialize it to default values.

Method Detail

getProperties

public Properties getProperties()
Returns the inner java properties.


getSetting

public String getSetting(String setting)
Returns the value match for the given setting. null if no setting is found.

Parameters:
setting - The setting name
Returns:
The value of the setting, or null if none is found

getSetting

public String getSetting(String setting,
                         String defaultValue)
Returns the value that matches the given setting. If none is found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
Returns:
The value of the setting, or defaultValue if none is found.

getSettingAsFloat

public float getSettingAsFloat(String setting,
                               float defaultValue)
Returns the float value that matches the given setting. If none if found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
Returns:
The value of the setting, or defaultValue if none is found.

getSettingAsInt

public int getSettingAsInt(String setting,
                           int defaultValue)
Returns the int value that matches the given setting. If none if found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
Returns:
The value of the setting, or defaultValue if none is found.

getSettingAsLong

public long getSettingAsLong(String setting,
                             long defaultValue)
Returns the long value that matches the given setting. If none if found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
Returns:
The value of the setting, or defaultValue if none is found.

getSettingAsClass

public Class getSettingAsClass(String setting,
                               Class defaultValue)
                        throws ClassNotFoundException
Returns the class value that matches the given setting. If none if found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
Returns:
The value of the setting, or defaultValue if none is found.
Throws:
ClassNotFoundException

getSettingAsClass

public Class getSettingAsClass(String setting,
                               Class defaultValue,
                               ClassLoader classLoader)
                        throws ClassNotFoundException
Returns the class value that matches the given setting. If none if found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
classLoader - The class loader to be used to load the class
Returns:
The value of the setting, or defaultValue if none is found.
Throws:
ClassNotFoundException

getSettingAsBoolean

public boolean getSettingAsBoolean(String setting,
                                   boolean defaultValue)
Returns the boolean value that matches the given setting. If none if found, the default value is used.

Parameters:
setting - The setting name
defaultValue - The default value to be used if no setting is found
Returns:
The value of the setting, or defaultValue if none is found.

setSetting

public JdbcFileEntrySettings setSetting(String setting,
                                        String value)

setBooleanSetting

public JdbcFileEntrySettings setBooleanSetting(String setting,
                                               boolean value)

setFloatSetting

public JdbcFileEntrySettings setFloatSetting(String setting,
                                             float value)

setIntSetting

public JdbcFileEntrySettings setIntSetting(String setting,
                                           int value)

setLongSetting

public JdbcFileEntrySettings setLongSetting(String setting,
                                            long value)

setClassSetting

public JdbcFileEntrySettings setClassSetting(String setting,
                                             Class clazz)


Copyright (c) 2004-2008 The Compass Project.