org.enableit.db.darrt
Class AbstractSchemaHandler

java.lang.Object
  |
  +--org.enableit.db.darrt.AbstractFileHandler
        |
        +--org.enableit.db.darrt.AbstractSchemaHandler
Direct Known Subclasses:
DataHandler, SchemaExporter, SchemaHandler, SchemaVisualiser, SchemaViz

public abstract class AbstractSchemaHandler
extends AbstractFileHandler

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

Author:
default

Field Summary
 
Fields inherited from class org.enableit.db.darrt.AbstractFileHandler
ABOUT
 
Constructor Summary
AbstractSchemaHandler()
           
 
Method Summary
 void addListener(org.enableit.db.darrt.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.
 java.util.List diffSchemas()
          Returns the differences between the reference and target schemas as a List of DiffData objects.
protected  org.enableit.db.beans.Database getDatabase(org.enableit.db.beans.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.beans.Provider getOnlineRefSchema()
           
 org.enableit.db.beans.Provider getOnlineTargetSchema()
           
 org.enableit.db.beans.Database getRefDatabase()
           
 java.lang.String getRefSchemaName()
           
 java.net.URL getRefSchemaUrl()
           
 java.lang.String getTablePattern()
           
 org.enableit.db.beans.Database getTargetDatabase()
           
 java.net.URL getTargetSchemaUrl()
          Specify a JDBC URL to use as the target data source.
 void setDebug(boolean debug)
           
 void setOnlineRefSchema(org.enableit.db.beans.Provider refProvider)
           
 void setOnlineTargetSchema(org.enableit.db.beans.Provider targetProvider)
           
 void setRefDatabase(org.enableit.db.beans.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.beans.Database targetDatabase)
           
 void setTargetSchemaUrl(java.net.URL newTargetSchemaUrl)
           
 
Methods inherited from class org.enableit.db.darrt.AbstractFileHandler
getOperDir, setOperDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSchemaHandler

public AbstractSchemaHandler()
Method Detail

getTablePattern

public java.lang.String getTablePattern()
Returns:
The table pattern to operate on.

setTablePattern

public void setTablePattern(java.lang.String tablePattern)
Parameters:
tablePattern - A pattern identifying tables to operate on.

Single chars may be represented by '_' and multiple chars by '%'.


getRefSchemaName

public java.lang.String getRefSchemaName()
Returns:
The name of the reference schema to operate on.

setRefSchemaName

public void setRefSchemaName(java.lang.String refSchemaName)
Parameters:
refSchemaName - The name of the reference schema to operate on.

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)
Parameters:
newTargetSchemaUrl -

setOnlineTargetSchema

public void setOnlineTargetSchema(org.enableit.db.beans.Provider targetProvider)
Parameters:
targetProvider - A Provider representing connection details for the target online schema.

getOnlineTargetSchema

public org.enableit.db.beans.Provider getOnlineTargetSchema()
Returns:
Provider representing connection details for the target online schema, or null if not set.

setTargetDatabase

public void setTargetDatabase(org.enableit.db.beans.Database targetDatabase)
Parameters:
targetDatabase - The object representation of the target schema.

getTargetDatabase

public org.enableit.db.beans.Database getTargetDatabase()
Returns:
The object representation of the target schema.

getRefSchemaUrl

public java.net.URL getRefSchemaUrl()
Returns:
URL for reference schema, or null if not set.

setRefSchemaUrl

public void setRefSchemaUrl(java.net.URL newSchemaUrl)
Parameters:
newSchemaUrl -

setOnlineRefSchema

public void setOnlineRefSchema(org.enableit.db.beans.Provider refProvider)
Parameters:
refProvider - A Provider representing connection details for the target online schema.

getOnlineRefSchema

public org.enableit.db.beans.Provider getOnlineRefSchema()
Returns:
Provider representing connection details for the reference online schema, or null if not set.

setRefDatabase

public void setRefDatabase(org.enableit.db.beans.Database refDatabase)

getRefDatabase

public org.enableit.db.beans.Database getRefDatabase()
Returns:
The object representation of the reference online schema

getDatabase

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

Throws:
SchemaHandlingException - If the database url is of an unknown type (i.e. do not know the Driver to use) or if an error occurs during the export.

diffSchemas

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

SchemaHandlingException

addListener

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

Parameters:
listener -

addListeners

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

Parameters:
listeners - List of DarrtListener instances.

getListeners

public java.util.List getListeners()
Returns:
List of registered listeners.

getDebug

public boolean getDebug()
Returns:
Whether debugging is enabled.

setDebug

public void setDebug(boolean debug)


Copyright © 1999-2004 enableIT.org. All Rights Reserved.