View Javadoc
1 /* 2 * PROJECT : DAR Runtime and Tools 3 * COPYRIGHT : Copyright (C) 1999-2004 tim.stephenson@enableit.org 4 * LICENSE : GNU LESSER GENERAL PUBLIC LICENSE 5 * Version 2.1, February 1999 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 22 package org.enableit.db.darrt.ant; 23 24 import org.apache.log4j.Logger; 25 import org.apache.tools.ant.BuildException; 26 import org.enableit.db.darrt.SchemaHandler; 27 import org.enableit.db.darrt.SchemaHandlingException; 28 29 30 /*** 31 * Ant Task to difference 2 database schemas represented in XML. 32 * 33 * @version __VERSION__ 34 * 35 * @author __AUTHOR__ 36 * 37 */ 38 public class DiffSchemaTask extends AbstractSchemaTask { 39 /*** 40 * The Log4J <code>Category</code> doing the logging. 41 */ 42 private static Logger logger = Logger.getLogger(DiffSchemaTask.class); 43 44 /*** 45 * Default constructor. 46 */ 47 public DiffSchemaTask() { 48 super(); 49 } 50 51 /*** 52 * Examine and report the differences. 53 */ 54 public void execute() { 55 checkInputs(); 56 57 /* 58 * Set up a SchemaHandler and do the diff 59 */ 60 try { 61 log("Analysing differences between: "); 62 63 SchemaHandler schemaHandler = getSchemaHandler(); 64 65 log("This may take several minutes...."); 66 schemaHandler.addListeners(getReportListeners()); 67 schemaHandler.diffSchemas(); 68 } catch (SchemaHandlingException e) { 69 throw new BuildException(e.getMessage()); 70 } catch (Exception e) { 71 throw new BuildException(e.getMessage(), e); 72 } 73 } 74 }

This page was automatically generated by Maven