org.enableit.db.darrt.ant
Class DarTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.apache.tools.ant.taskdefs.Zip
                          |
                          +--org.apache.tools.ant.taskdefs.Jar
                                |
                                +--org.enableit.db.darrt.ant.DarTask
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class DarTask
extends org.apache.tools.ant.taskdefs.Jar

Creates a DAR archive.

Author:
Tim Stephenson

Field Summary
static java.lang.String ABOUT
          CVS info ABOUT this class and its current version
protected  java.lang.String targetDriver
          The JDBC driver's class name.
protected  java.lang.String targetPassword
          Password to use when connecting to the database.
protected  java.lang.String targetUrl
          The database URL to connect to.
protected  java.lang.String targetUserid
          Username to use when connecting to the database.
 
Fields inherited from class org.apache.tools.ant.taskdefs.Zip
addedDirs, archiveType, duplicate, emptyBehavior, entries, zipFile
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset, useDefaultExcludes
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
DarTask()
          Default constructor.
 
Method Summary
 void addData(org.apache.tools.ant.types.ZipFileSet fs)
          Adds a zipfileset, specifying the data files to add to the DAR.
 void addLib(org.apache.tools.ant.types.ZipFileSet fs)
          Adds a zipfileset, specifying libraries to add to the DAR.
 void addProcedures(org.apache.tools.ant.types.ZipFileSet fs)
          Adds a zipfileset, specifying the stored procedure code to add to the DAR.
 void addSchema(org.apache.tools.ant.types.FileSet fs)
          Add schema information to the DAR.
protected  void cleanUp()
          Make sure we don't think we already have a schema.xml next time this task gets executed.
 void execute()
           
protected  void initZipOutputStream(org.apache.tools.zip.ZipOutputStream zOut)
          Method required by Ant archive-handling tasks.
 void setSchemaxml(java.io.File descr)
          Set the schema descriptor for this DAR file.
 void setTargetDriver(java.lang.String driver)
          Sets the JDBC driver to use in making a connection
 void setTargetPassword(java.lang.String password)
          Sets the JDBC password to use in making a connection
 void setTargetSchemaName(java.lang.String targetSchemaName)
           
 void setTargetUrl(java.lang.String url)
          Sets the JDBC url to connect to.
 void setTargetUserid(java.lang.String userid)
          Sets the JDBC userid to use in making a connection
protected  void zipFile(java.io.File file, org.apache.tools.zip.ZipOutputStream zOut, java.lang.String vPath)
          Method required by Ant archive-handling tasks.
 
Methods inherited from class org.apache.tools.ant.taskdefs.Jar
addConfiguredManifest, addMetainf, createEmptyZip, finalizeZipOutputStream, isUpToDate, reset, setIndex, setJarfile, setManifest, setWhenempty, zipFile
 
Methods inherited from class org.apache.tools.ant.taskdefs.Zip
addFiles, addFiles, addFileset, addParentDirs, addZipEntries, addZipfileset, addZipGroupFileset, grabFileNames, grabFiles, grabFiles, isAddingNewFiles, isInUpdateMode, setBasedir, setCompress, setDestFile, setDuplicate, setEncoding, setFile, setFilesonly, setUpdate, setZipfile, zipDir
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
addAnd, addContains, addCustom, addDate, addDepend, addDepth, addFilename, addMajority, addNone, addNot, addOr, addPresent, addSelector, addSize, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABOUT

public static final java.lang.String ABOUT
CVS info ABOUT this class and its current version

See Also:
Constant Field Values

targetDriver

protected java.lang.String targetDriver
The JDBC driver's class name.


targetUrl

protected java.lang.String targetUrl
The database URL to connect to.


targetUserid

protected java.lang.String targetUserid
Username to use when connecting to the database.


targetPassword

protected java.lang.String targetPassword
Password to use when connecting to the database.

Constructor Detail

DarTask

public DarTask()
Default constructor.

Method Detail

setTargetDriver

public void setTargetDriver(java.lang.String driver)
Sets the JDBC driver to use in making a connection


setTargetUrl

public void setTargetUrl(java.lang.String url)
Sets the JDBC url to connect to.


setTargetUserid

public void setTargetUserid(java.lang.String userid)
Sets the JDBC userid to use in making a connection


setTargetPassword

public void setTargetPassword(java.lang.String password)
Sets the JDBC password to use in making a connection


setTargetSchemaName

public void setTargetSchemaName(java.lang.String targetSchemaName)

setSchemaxml

public void setSchemaxml(java.io.File descr)
Set the schema descriptor for this DAR file.

Parameters:
descr - File representing the descriptor.

addLib

public void addLib(org.apache.tools.ant.types.ZipFileSet fs)
Adds a zipfileset, specifying libraries to add to the DAR.

TODO: At this point there is no functionality defined for these libraries. It could be used in the future to specify jars to install in Java-enabled databases or to specify the darrt jars themselves.

Parameters:
fs - FileSet to add to archive.

addData

public void addData(org.apache.tools.ant.types.ZipFileSet fs)
Adds a zipfileset, specifying the data files to add to the DAR.

Parameters:
fs - FileSet to add to archive.

addProcedures

public void addProcedures(org.apache.tools.ant.types.ZipFileSet fs)
Adds a zipfileset, specifying the stored procedure code to add to the DAR.

Parameters:
fs - FileSet to add to archive.

addSchema

public void addSchema(org.apache.tools.ant.types.FileSet fs)
Add schema information to the DAR.

Parameters:
fs - Specifies the schema in individual table chunks.

initZipOutputStream

protected void initZipOutputStream(org.apache.tools.zip.ZipOutputStream zOut)
                            throws java.io.IOException,
                                   org.apache.tools.ant.BuildException
Method required by Ant archive-handling tasks.

Overrides:
initZipOutputStream in class org.apache.tools.ant.taskdefs.Jar
Parameters:
zOut - Compressed output stream of containing the archive??
Throws:
java.io.IOException - If there is a problem with file access.
org.apache.tools.ant.BuildException - If descriptor is missing.

zipFile

protected void zipFile(java.io.File file,
                       org.apache.tools.zip.ZipOutputStream zOut,
                       java.lang.String vPath)
                throws java.io.IOException
Method required by Ant archive-handling tasks.

Overrides:
zipFile in class org.apache.tools.ant.taskdefs.Jar
Parameters:
file - The target file to write to ??.
zOut - Compressed output stream of containing the archive.
vPath - ?? .
Throws:
java.io.IOException - If there is a problem with file access.

cleanUp

protected void cleanUp()
Make sure we don't think we already have a schema.xml next time this task gets executed.

Overrides:
cleanUp in class org.apache.tools.ant.taskdefs.Jar

execute

public void execute()
Overrides:
execute in class org.apache.tools.ant.taskdefs.Zip


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