View Javadoc

1   package migratool;
2   
3   import org.apache.log4j.Logger;
4   import org.apache.log4j.PropertyConfigurator;
5   
6   
7   /**
8    * 
9    * MIGRATOOL Program to migrate spatial databsets.
10   * Copyright (C) 2007 Fábio Luiz Leite Júnior
11   * Universidade Federal de Campina Grande
12   * contact: fabioleite@gmail.com
13   *
14   * This program is free software; you can redistribute it and/or
15   * modify it under the terms of the GNU General Public License
16   * as published by the Free Software Foundation; either version 2
17   * of the License, or (at your option) any later version.
18   *
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   *
24   * You should have received a copy of the GNU General Public License
25   * along with this program; if not, write to the Free Software
26   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
27   *
28   * @author fabio
29   *
30   */
31  
32  public class MigratoolApp {
33  	static Logger logger = Logger.getLogger(MigratoolApp.class.getName());
34  
35  	public static void main(String[] args){
36  		PropertyConfigurator.configure("confLogFile.txt");
37  		Migratool migCenter = new Migratool();
38  		logger.info("Entering application.");
39  		try {
40  			logger.info("lendo XML...");
41  			migCenter.init("conf/mig-config.xml");
42  			logger.info("XML lido.");
43  		} catch (MigratoolException e1) {
44  			e1.printStackTrace();
45  			System.exit(0);
46  		}
47  		
48  		logger.info("antes de testar a origem");
49  		boolean testBDSource = migCenter.testOriginDataSource();
50  		logger.info("Testando bd: " + testBDSource);
51  		/*
52  		boolean testOriginBD = migCenter.testDestinationDataSource();
53  		logger.info("Testando bd Destination: " + testOriginBD);
54  		*/
55  		try {
56  			migCenter.migrate();
57  			//migCenter.createDestinationSchema();
58  		} catch (Exception e) {
59  			e.printStackTrace();
60  		}
61  		migCenter.clearConnections();
62  		logger.info("fim de programa");
63  	}
64  }