org.apache.torque.mojo
Class IdentifyInvalidDataFiles

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.BaseMojo
          extended by org.apache.torque.mojo.IdentifyInvalidDataFiles
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class IdentifyInvalidDataFiles
extends BaseMojo

This mojo identifies data files that are present on the file system but are not present in schema.xml. This can happen if a table is removed from the schema. It sets a project property called "impex.data.invalid". This property is a comma delimited list of filenames that have no match in the db schema. If it finds any invalid files it will also set the project property "impex.found.invalid=true"


Field Summary
 
Fields inherited from class org.apache.torque.mojo.BaseMojo
SKIP_PACKAGING_TYPE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
IdentifyInvalidDataFiles()
           
 
Method Summary
protected  void createFile(File file, String contents)
           
protected  void executeMojo()
           
protected  List<String> getContents(File file)
           
protected  Set<File> getDatabaseFiles(org.apache.torque.engine.database.model.Database db)
           
 File getDataDir()
           
 String getDataDirExcludes()
           
 String getDataDirIncludes()
           
protected  org.apache.tools.ant.DirectoryScanner getDirectoryScanner()
           
protected  Set<File> getExistingFiles(org.apache.tools.ant.DirectoryScanner ds)
           
protected  Set<File> getExportedFiles()
           
protected  Set<File> getExportedFiles(List<String> tablenames)
           
 String getExtension()
           
protected  File getFile(org.apache.torque.engine.database.model.Table table)
           
 File getMarkedForRemoval()
           
 String getSchemaXMLFile()
           
 String getTargetDatabase()
           
 void setDataDir(File dataDir)
           
 void setDataDirExcludes(String dataDirExcludes)
           
 void setDataDirIncludes(String dataDirIncludes)
           
 void setExtension(String extension)
           
 void setMarkedForRemoval(File markedForRemoval)
           
 void setSchemaXMLFile(String schemaXMLFile)
           
 void setTargetDatabase(String targetDatabase)
           
 
Methods inherited from class org.apache.torque.mojo.BaseMojo
afterExecution, beforeExecution, execute, getEncoding, getMavenSession, getProject, getSettings, isForceMojoExecution, isSkip, isStartMavenLogger, setEncoding, setForceMojoExecution, setMavenSession, setProject, setSettings, setSkip, setStartMavenLogger, skipMojo
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentifyInvalidDataFiles

public IdentifyInvalidDataFiles()
Method Detail

getExportedFiles

protected Set<File> getExportedFiles()
                              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getExportedFiles

protected Set<File> getExportedFiles(List<String> tablenames)

getContents

protected List<String> getContents(File file)
                            throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

executeMojo

protected void executeMojo()
                    throws org.apache.maven.plugin.MojoExecutionException,
                           org.apache.maven.plugin.MojoFailureException
Specified by:
executeMojo in class BaseMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

createFile

protected void createFile(File file,
                          String contents)
                   throws IOException
Throws:
IOException

getDatabaseFiles

protected Set<File> getDatabaseFiles(org.apache.torque.engine.database.model.Database db)

getExistingFiles

protected Set<File> getExistingFiles(org.apache.tools.ant.DirectoryScanner ds)

getDirectoryScanner

protected org.apache.tools.ant.DirectoryScanner getDirectoryScanner()

getFile

protected File getFile(org.apache.torque.engine.database.model.Table table)

getDataDir

public File getDataDir()

setDataDir

public void setDataDir(File dataDir)

getDataDirIncludes

public String getDataDirIncludes()

setDataDirIncludes

public void setDataDirIncludes(String dataDirIncludes)

getDataDirExcludes

public String getDataDirExcludes()

setDataDirExcludes

public void setDataDirExcludes(String dataDirExcludes)

getSchemaXMLFile

public String getSchemaXMLFile()

setSchemaXMLFile

public void setSchemaXMLFile(String schemaXMLFile)

getExtension

public String getExtension()

setExtension

public void setExtension(String extension)

getTargetDatabase

public String getTargetDatabase()

setTargetDatabase

public void setTargetDatabase(String targetDatabase)

getMarkedForRemoval

public File getMarkedForRemoval()

setMarkedForRemoval

public void setMarkedForRemoval(File markedForRemoval)


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.