JavaDoc


pgMetaDataInfo

org.dbreplicator.replication
Class pgMetaDataInfo

java.lang.Object
  extended by org.dbreplicator.replication.MetaDataInfo
      extended by org.dbreplicator.replication.pgMetaDataInfo

public class pgMetaDataInfo
extends MetaDataInfo

This Class gets the connection object of the specified publisher or subscriber and then stores it's metadata information in the DataBaseMetaData object(dbmd). This inforamtion is used for performing different operations on the tables of the publication or subscription and on the columns and constraint.


Constructor Summary
pgMetaDataInfo(java.sql.Connection connection0)
           
pgMetaDataInfo(ConnectionPool connectionPool0, java.lang.String pubsubName)
           
 
Method Summary
 void addCheckConstraintForExistingTable(java.lang.String schemaName, java.lang.String tableName, java.util.TreeMap primConsMap, AbstractDataBaseHandler dbh)
           
 void appendUniqueKeyConstraints(java.lang.String schemaName, java.lang.String tableName, java.lang.StringBuffer cols)
           
 void checkParentTablesIncludedInList(java.util.ArrayList givenListOfTables, java.lang.String schemaName, java.lang.String tableName)
          This method check that the parent table of given table is included or not.
 void checkTableExistance(SchemaQualifiedName sname)
          Checks the existance of the pericular table in the database.
 void checkTableSequenceAccordingForeignKey(java.lang.String schemaName, java.lang.String tableName, java.util.ArrayList tableList)
          Check the sequence of table according to primary key.
 java.lang.String generateColumnsQueryForClientNode(AbstractDataBaseHandler dbh, int srcVendorType, java.lang.String schemaName, java.lang.String tableName, int tgtVendorType)
          Generating a query ---- [ columnName dataType[(size)] [default] [not null] , [ columnName dataType[(size)] [default] [not null] ,...]]
 java.lang.String getAppliedConstraints(java.lang.String schemaName, java.lang.String tableName, java.util.TreeMap primConsMap)
          Gets the sequence of different constraint along with datatype in the query formate.
 java.lang.String getAppliedConstraintsForExistingTable(java.lang.String schemaName, java.lang.String tableName, java.util.TreeMap primConsMap, AbstractDataBaseHandler dbh)
           
 java.lang.String getCatalogName(java.lang.String identifier)
           
 java.util.ArrayList getChildTables(java.lang.String parentTable)
           
 java.util.ArrayList getColumnDataTypeInfo(AbstractDataBaseHandler dbh, java.lang.String schemaName, java.lang.String tableName)
          For each column, its dataype is converted in respective database datatype format in typeinfo then it is set in the dbh, passed to Class ColumnsInfo and it's objects are stored in colInfoList.
 java.util.HashMap getColumnsInfo(java.lang.String schemaName, java.lang.String tableName)
           
 java.lang.String getExistingTableQuery(AbstractDataBaseHandler dbh, SchemaQualifiedName sname, int pubVendorType)
           
 java.util.ArrayList getExportedTableCols(SchemaQualifiedName repTable)
           
 java.util.ArrayList getForeignKeyConstraints(java.lang.String schemaName, java.lang.String tableName)
           
 java.lang.Object[] getImportedColsOfChildTable(java.lang.String parentTable, java.lang.String childTable)
           
 java.util.ArrayList getImportedTables(SchemaQualifiedName schemaQualifiedName, java.util.List passedSchemaQualifiedNamesList, DirectedGraph graph, java.lang.String[] removeCycleTableNames0)
           
 java.lang.String getSchemaName(java.lang.String identifier)
           
 java.lang.String getTableName(java.lang.String schematable)
          Implemented to handle the casesensitveness of postgreSQL for table and and Schema Name.Method is overrided in pgMetaDataInfo.
 java.lang.String[] getTablesHierarchy(java.lang.String[] tableNames)
          Return the hierarchy of tables based on parent child relationship.
 void setAllColumns(RepTable repTable, java.lang.String schemaName, java.lang.String tableName)
           
 void setPrimaryColumns(RepTable repTable, java.lang.String schemaName, java.lang.String tableName)
           
 
Methods inherited from class org.dbreplicator.replication.MetaDataInfo
getExportedTableColsList, getImportedTablesInfo, setForeignKeyColumns
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

pgMetaDataInfo

public pgMetaDataInfo(ConnectionPool connectionPool0,
                      java.lang.String pubsubName)
               throws RepException
Throws:
RepException

pgMetaDataInfo

public pgMetaDataInfo(java.sql.Connection connection0)
               throws RepException
Throws:
RepException
Method Detail

checkTableExistance

public void checkTableExistance(SchemaQualifiedName sname)
                         throws RepException
Description copied from class: MetaDataInfo
Checks the existance of the pericular table in the database.

Overrides:
checkTableExistance in class MetaDataInfo
Throws:
RepException

getTablesHierarchy

public java.lang.String[] getTablesHierarchy(java.lang.String[] tableNames)
                                      throws RepException
Description copied from class: MetaDataInfo
Return the hierarchy of tables based on parent child relationship. Parent child relationship depend on Primary key and Foreign Key Relationship.It first add the parent table in array and after that child tables.

Parameters:
tableNames - String[]
Returns:
String[]
Throws:
RepException

checkParentTablesIncludedInList

public void checkParentTablesIncludedInList(java.util.ArrayList givenListOfTables,
                                            java.lang.String schemaName,
                                            java.lang.String tableName)
                                     throws RepException
Description copied from class: MetaDataInfo
This method check that the parent table of given table is included or not. If parent table not included in list then it give the RepException because further it create the problem in synchronization.

Parameters:
givenListOfTables - ArrayList
schemaName - String
tableName - String
Throws:
RepException

checkTableSequenceAccordingForeignKey

public void checkTableSequenceAccordingForeignKey(java.lang.String schemaName,
                                                  java.lang.String tableName,
                                                  java.util.ArrayList tableList)
                                           throws RepException
Description copied from class: MetaDataInfo
Check the sequence of table according to primary key. If table are not sorted order then throw the error It checks that if there is a table with any primary key and some foreign keys then all the tables of foreign key columns are also included in the publisher or not.

Overrides:
checkTableSequenceAccordingForeignKey in class MetaDataInfo
Parameters:
schemaName - String
tableName - String
tableList - ArrayList
Throws:
RepException

getColumnDataTypeInfo

public java.util.ArrayList getColumnDataTypeInfo(AbstractDataBaseHandler dbh,
                                                 java.lang.String schemaName,
                                                 java.lang.String tableName)
                                          throws RepException,
                                                 java.sql.SQLException
Description copied from class: MetaDataInfo
For each column, its dataype is converted in respective database datatype format in typeinfo then it is set in the dbh, passed to Class ColumnsInfo and it's objects are stored in colInfoList.

Overrides:
getColumnDataTypeInfo in class MetaDataInfo
Returns:
ArrayList
Throws:
RepException
java.sql.SQLException

getColumnsInfo

public java.util.HashMap getColumnsInfo(java.lang.String schemaName,
                                        java.lang.String tableName)
                                 throws RepException,
                                        java.sql.SQLException
Overrides:
getColumnsInfo in class MetaDataInfo
Throws:
RepException
java.sql.SQLException

generateColumnsQueryForClientNode

public java.lang.String generateColumnsQueryForClientNode(AbstractDataBaseHandler dbh,
                                                          int srcVendorType,
                                                          java.lang.String schemaName,
                                                          java.lang.String tableName,
                                                          int tgtVendorType)
                                                   throws RepException
Description copied from class: MetaDataInfo
Generating a query ---- [ columnName dataType[(size)] [default] [not null] , [ columnName dataType[(size)] [default] [not null] ,...]]

Overrides:
generateColumnsQueryForClientNode in class MetaDataInfo
Parameters:
dbh -
srcVendorType -
schemaName -
tableName -
tgtVendorType -
Returns:
String
Throws:
java.sql.SQLException
RepException

getAppliedConstraints

public java.lang.String getAppliedConstraints(java.lang.String schemaName,
                                              java.lang.String tableName,
                                              java.util.TreeMap primConsMap)
                                       throws RepException
Description copied from class: MetaDataInfo
Gets the sequence of different constraint along with datatype in the query formate.

Overrides:
getAppliedConstraints in class MetaDataInfo
Returns:
String
Throws:
RepException

getAppliedConstraintsForExistingTable

public java.lang.String getAppliedConstraintsForExistingTable(java.lang.String schemaName,
                                                              java.lang.String tableName,
                                                              java.util.TreeMap primConsMap,
                                                              AbstractDataBaseHandler dbh)
                                                       throws RepException
Overrides:
getAppliedConstraintsForExistingTable in class MetaDataInfo
Throws:
RepException

addCheckConstraintForExistingTable

public void addCheckConstraintForExistingTable(java.lang.String schemaName,
                                               java.lang.String tableName,
                                               java.util.TreeMap primConsMap,
                                               AbstractDataBaseHandler dbh)
                                        throws RepException
Overrides:
addCheckConstraintForExistingTable in class MetaDataInfo
Throws:
RepException

setPrimaryColumns

public void setPrimaryColumns(RepTable repTable,
                              java.lang.String schemaName,
                              java.lang.String tableName)
                       throws RepException,
                              java.sql.SQLException
Overrides:
setPrimaryColumns in class MetaDataInfo
Throws:
RepException
java.sql.SQLException

getCatalogName

public java.lang.String getCatalogName(java.lang.String identifier)
Overrides:
getCatalogName in class MetaDataInfo

getSchemaName

public java.lang.String getSchemaName(java.lang.String identifier)
Overrides:
getSchemaName in class MetaDataInfo

getTableName

public java.lang.String getTableName(java.lang.String schematable)
Description copied from class: MetaDataInfo
Implemented to handle the casesensitveness of postgreSQL for table and and Schema Name.Method is overrided in pgMetaDataInfo.

Overrides:
getTableName in class MetaDataInfo
Parameters:
schematable - String
Returns:
String

getExistingTableQuery

public java.lang.String getExistingTableQuery(AbstractDataBaseHandler dbh,
                                              SchemaQualifiedName sname,
                                              int pubVendorType)
                                       throws RepException,
                                              java.sql.SQLException
Overrides:
getExistingTableQuery in class MetaDataInfo
Throws:
RepException
java.sql.SQLException

getChildTables

public java.util.ArrayList getChildTables(java.lang.String parentTable)
                                   throws RepException
Specified by:
getChildTables in class MetaDataInfo
Throws:
RepException

getImportedColsOfChildTable

public java.lang.Object[] getImportedColsOfChildTable(java.lang.String parentTable,
                                                      java.lang.String childTable)
                                               throws RepException
Specified by:
getImportedColsOfChildTable in class MetaDataInfo
Throws:
RepException

getImportedTables

public java.util.ArrayList getImportedTables(SchemaQualifiedName schemaQualifiedName,
                                             java.util.List passedSchemaQualifiedNamesList,
                                             DirectedGraph graph,
                                             java.lang.String[] removeCycleTableNames0)
                                      throws RepException
Specified by:
getImportedTables in class MetaDataInfo
Throws:
RepException

getForeignKeyConstraints

public java.util.ArrayList getForeignKeyConstraints(java.lang.String schemaName,
                                                    java.lang.String tableName)
                                             throws RepException
Specified by:
getForeignKeyConstraints in class MetaDataInfo
Throws:
RepException

appendUniqueKeyConstraints

public void appendUniqueKeyConstraints(java.lang.String schemaName,
                                       java.lang.String tableName,
                                       java.lang.StringBuffer cols)
                                throws RepException
Specified by:
appendUniqueKeyConstraints in class MetaDataInfo
Throws:
RepException

getExportedTableCols

public java.util.ArrayList getExportedTableCols(SchemaQualifiedName repTable)
                                         throws RepException
Specified by:
getExportedTableCols in class MetaDataInfo
Throws:
RepException

setAllColumns

public void setAllColumns(RepTable repTable,
                          java.lang.String schemaName,
                          java.lang.String tableName)
                   throws RepException,
                          java.sql.SQLException
Specified by:
setAllColumns in class MetaDataInfo
Throws:
RepException
java.sql.SQLException



Powered by Drupal - Theme by Danger4k