|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opennms.netmgt.config.DatabaseSchemaConfigFactory
public final class DatabaseSchemaConfigFactory
This is the singleton class used to load the configuration for the OpenNMS database schema for the filters from the database-schema XML file. Note: Users of this class should make sure the init() is called before calling any other method to ensure the config is loaded before accessing other convenience methods.
| Constructor Summary | |
|---|---|
DatabaseSchemaConfigFactory(InputStream is)
Constructor for DatabaseSchemaConfigFactory. |
|
DatabaseSchemaConfigFactory(Reader reader)
Deprecated. |
|
| Method Summary | |
|---|---|
String |
constructJoinExprForTables(List<Table> tables)
Construct a SQL FROM clause joining the given tables to the primary table. |
Table |
findTableByVisibleColumn(String colName)
Find the table which has a visible column named 'colName' |
DatabaseSchema |
getDatabaseSchema()
Return the database schema. |
static DatabaseSchemaConfigFactory |
getInstance()
Return the singleton instance of this factory. |
List<String> |
getJoinTables(List<Table> tables)
Return the sequence of tables necessary to join the primary table to the given tables. |
Table |
getPrimaryTable()
This method is used to find the table that should drive the construction of the join clauses between all table in the from clause. |
Table |
getTableByName(String name)
Find a table using its name as the search key. |
int |
getTableCount()
Return a count of the number of tables defined. |
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
static void |
reload()
Reload the config from the default config file |
static void |
setInstance(DatabaseSchemaConfigFactory instance)
setInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated
public DatabaseSchemaConfigFactory(Reader reader)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
Constructor for DatabaseSchemaConfigFactory.
reader - a Reader object.
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
public DatabaseSchemaConfigFactory(InputStream is)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
Constructor for DatabaseSchemaConfigFactory.
is - a InputStream object.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.| Method Detail |
|---|
public static void init()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException - Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
public static void reload()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException - Thrown if the specified config file cannot be read/loaded
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.public static DatabaseSchemaConfigFactory getInstance()
IllegalStateException - Thrown if the factory has not yet been initialized.public static void setInstance(DatabaseSchemaConfigFactory instance)
setInstance
instance - a DatabaseSchemaConfigFactory object.public DatabaseSchema getDatabaseSchema()
public Table getPrimaryTable()
public Table getTableByName(String name)
name - the name of the table to find
public Table findTableByVisibleColumn(String colName)
colName - a String object.
public int getTableCount()
public List<String> getJoinTables(List<Table> tables)
tables - list of Tables to join
public String constructJoinExprForTables(List<Table> tables)
tables - list of Tables to join
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||