Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enableit.db.darrt
Class AbstractSchemaHandler  view AbstractSchemaHandler download AbstractSchemaHandler.java

java.lang.Object
  extended byorg.enableit.db.darrt.AbstractSchemaHandler
Direct Known Subclasses:
DataHandler, SchemaExporter, SchemaHandler

public abstract class AbstractSchemaHandler
extends java.lang.Object

An abstract ancestor that takes care of many of the common operations required when handling the XML and JDBC metadata.


Field Summary
private  boolean debug
           
private  java.util.ArrayList listeners
           
private static org.apache.log4j.Logger logger
          The Log4J Logger doing the logging.
private  org.enableit.db.darrt.schema.Provider onlineRefSchema
           
private  org.enableit.db.darrt.schema.Provider onlineTargetSchema
           
private  org.enableit.db.darrt.schema.Database refDatabase
           
private  java.lang.String refSchemaName
          The reference schema name.
private  java.net.URL refSchemaUrl
           
private  java.lang.String tablePattern
          The table pattern to operate on.
private  org.enableit.db.darrt.schema.Database targetDatabase
           
private  java.net.URL targetSchemaUrl
           
 
Constructor Summary
AbstractSchemaHandler()
           
 
Method Summary
 void addListener(DarrtListener listener)
          Add a class interested in receiving events from the AbstractSchemaHandler.
 void addListeners(java.util.List listeners)
          Add one or more classes interested in receiving events from the AbstractSchemaHandler.
private  void checkMandatory()
          Checks the mandatory properties have been set, so can continue.
 java.util.List diffSchemas()
          Returns the differences between the reference and target schemas as a List of DiffData objects.
protected  org.enableit.db.darrt.schema.Database getDatabase(org.enableit.db.darrt.schema.Provider provider)
          Extracts a database schema from a JDBC URL by infering the database type and driver name.
 boolean getDebug()
           
 java.util.List getListeners()
           
 org.enableit.db.darrt.schema.Provider getOnlineRefSchema()
           
 org.enableit.db.darrt.schema.Provider getOnlineTargetSchema()
           
 org.enableit.db.darrt.schema.Database getRefDatabase()
           
 java.lang.String getRefSchemaName()
           
 java.net.URL getRefSchemaUrl()
           
 java.lang.String getTablePattern()
           
 org.enableit.db.darrt.schema.Database getTargetDatabase()
           
 java.net.URL getTargetSchemaUrl()
          Specify a JDBC URL to use as the target data source.
private  void parseSchemas()
          Parses a schema.
private  void raiseEvent(int eventId, java.lang.Object eventBean)
          Notify listeners of the specified event.
 void setDebug(boolean debug)
           
 void setOnlineRefSchema(org.enableit.db.darrt.schema.Provider refProvider)
           
 void setOnlineTargetSchema(org.enableit.db.darrt.schema.Provider targetProvider)
           
 void setRefDatabase(org.enableit.db.darrt.schema.Database refDatabase)
           
 void setRefSchemaName(java.lang.String refSchemaName)
           
 void setRefSchemaUrl(java.net.URL newSchemaUrl)
           
 void setTablePattern(java.lang.String tablePattern)
           
 void setTargetDatabase(org.enableit.db.darrt.schema.Database targetDatabase)
           
 void setTargetSchemaUrl(java.net.URL newTargetSchemaUrl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private java.util.ArrayList listeners

refSchemaUrl

private java.net.URL refSchemaUrl

targetSchemaUrl

private java.net.URL targetSchemaUrl

onlineRefSchema

private org.enableit.db.darrt.schema.Provider onlineRefSchema

onlineTargetSchema

private org.enableit.db.darrt.schema.Provider onlineTargetSchema

refDatabase

private org.enableit.db.darrt.schema.Database refDatabase

targetDatabase

private org.enableit.db.darrt.schema.Database targetDatabase

debug

private boolean debug

refSchemaName

private java.lang.String refSchemaName
The reference schema name.


tablePattern

private java.lang.String tablePattern
The table pattern to operate on.


logger

private static org.apache.log4j.Logger logger
The Log4J Logger doing the logging.

Constructor Detail

AbstractSchemaHandler

public AbstractSchemaHandler()
Method Detail

getTablePattern

public java.lang.String getTablePattern()

setTablePattern

public void setTablePattern(java.lang.String tablePattern)

getRefSchemaName

public java.lang.String getRefSchemaName()

setRefSchemaName

public void setRefSchemaName(java.lang.String refSchemaName)

getTargetSchemaUrl

public java.net.URL getTargetSchemaUrl()
Specify a JDBC URL to use as the target data source.


setTargetSchemaUrl

public void setTargetSchemaUrl(java.net.URL newTargetSchemaUrl)

setOnlineTargetSchema

public void setOnlineTargetSchema(org.enableit.db.darrt.schema.Provider targetProvider)

getOnlineTargetSchema

public org.enableit.db.darrt.schema.Provider getOnlineTargetSchema()

setTargetDatabase

public void setTargetDatabase(org.enableit.db.darrt.schema.Database targetDatabase)

getTargetDatabase

public org.enableit.db.darrt.schema.Database getTargetDatabase()

getRefSchemaUrl

public java.net.URL getRefSchemaUrl()

setRefSchemaUrl

public void setRefSchemaUrl(java.net.URL newSchemaUrl)

setOnlineRefSchema

public void setOnlineRefSchema(org.enableit.db.darrt.schema.Provider refProvider)

getOnlineRefSchema

public org.enableit.db.darrt.schema.Provider getOnlineRefSchema()

setRefDatabase

public void setRefDatabase(org.enableit.db.darrt.schema.Database refDatabase)

getRefDatabase

public org.enableit.db.darrt.schema.Database getRefDatabase()

getDatabase

protected org.enableit.db.darrt.schema.Database getDatabase(org.enableit.db.darrt.schema.Provider provider)
                                                     throws SchemaHandlingException
Extracts a database schema from a JDBC URL by infering the database type and driver name.


parseSchemas

private void parseSchemas()
                   throws SchemaHandlingException
Parses a schema.


diffSchemas

public java.util.List diffSchemas()
                           throws SchemaHandlingException
Returns the differences between the reference and target schemas as a List of DiffData objects.


checkMandatory

private void checkMandatory()
                     throws SchemaHandlingException
Checks the mandatory properties have been set, so can continue.


addListener

public void addListener(DarrtListener listener)
Add a class interested in receiving events from the AbstractSchemaHandler.


addListeners

public void addListeners(java.util.List listeners)
Add one or more classes interested in receiving events from the AbstractSchemaHandler.


raiseEvent

private void raiseEvent(int eventId,
                        java.lang.Object eventBean)
Notify listeners of the specified event.


getListeners

public java.util.List getListeners()

getDebug

public boolean getDebug()

setDebug

public void setDebug(boolean debug)