Source Code Cross Referenced for MigrationInformation.java in  » Project-Management » XPlanner-0.7b7 » com » tacitknowledge » util » migration » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Project Management » XPlanner 0.7b7 » com.tacitknowledge.util.migration.jdbc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2006 Your Corporation. All Rights Reserved.
003:         */
004:
005:        /*
006:         * Created by IntelliJ IDEA.
007:         * User: Jacques
008:         * Date: Feb 27, 2006
009:         * Time: 8:11:56 PM
010:         */
011:        package com.tacitknowledge.util.migration.jdbc;
012:
013:        import org.apache.commons.logging.Log;
014:        import org.apache.commons.logging.LogFactory;
015:
016:        /**
017:         * Launches the migration process as a standalone application.
018:         * <p>
019:         * This class expects the following Java environment parameters:
020:         * <ul>
021:         *    <li>migration.systemname - the name of the logical system being migrated</li>
022:         * </ul>
023:         * <p>
024:         * Below is an example of how this class can be configured in an Ant build.xml file:
025:         * <pre>
026:         *   ...
027:         *  &lt;target name="patch.information" description="Prints out information about patch levels"&gt;
028:         *   &lt;java
029:         *       fork="true"
030:         *       classpathref="patch.classpath"
031:         *       failonerror="true"
032:         *       classname="com.tacitknowledge.util.migration.jdbc.MigrationInformation"&gt;
033:         *     &lt;sysproperty key="migration.systemname" value="${application.name}"/&gt;
034:         *   &lt;/java&gt;
035:         * &lt;/target&gt;
036:         *   ...
037:         * </pre>
038:         *
039:         * @author  Mike Hardy (mike@tacitknowledge.com)
040:         * @version $Id: MigrationInformation.java,v 1.10 2005/09/07 22:20:34 chrisa Exp $
041:         * @see     com.tacitknowledge.util.migration.MigrationProcess
042:         */
043:        public class MigrationInformation {
044:            /** Class logger */
045:            private static Log log = LogFactory
046:                    .getLog(MigrationInformation.class);
047:
048:            /**
049:             * Private constructor - this object shouldn't be instantiated
050:             */
051:            private MigrationInformation() {
052:                // does nothing
053:            }
054:
055:            /**
056:             * Get the migration level information for the given system name
057:             *
058:             * @param arguments the command line arguments, if any (none are used)
059:             * @exception Exception if anything goes wrong
060:             */
061:            public static void main(String[] arguments) throws Exception {
062:                MigrationInformation info = new MigrationInformation();
063:                String migrationName = System
064:                        .getProperty("migration.systemname");
065:                if (migrationName == null) {
066:                    if ((arguments != null) && (arguments.length > 0)) {
067:                        migrationName = arguments[0].trim();
068:                    }
069:                }
070:                info.getMigrationInformation(migrationName);
071:            }
072:
073:            /**
074:             * Get the migration level information for the given system name
075:             *
076:             * @param systemName the name of the system
077:             * @throws Exception if anything goes wrong
078:             */
079:            public void getMigrationInformation(String systemName)
080:                    throws Exception {
081:                if (systemName == null) {
082:                    throw new IllegalArgumentException(
083:                            "The migration.systemname "
084:                                    + "system property is required");
085:                }
086:
087:                // The MigrationLauncher is responsible for handling the interaction
088:                // between the PatchTable and the underlying MigrationTasks; as each
089:                // task is executed, the patch level is incremented, etc.
090:                try {
091:                    JdbcMigrationLauncherFactory launcherFactory = MigrationLauncherFactoryLoader
092:                            .createFactory();
093:                    JdbcMigrationLauncher launcher = launcherFactory
094:                            .createMigrationLauncher(systemName);
095:                    log.info("Current Database patch level is        : "
096:                            + launcher.getDatabasePatchLevel());
097:                    int unappliedPatches = launcher.getNextPatchLevel()
098:                            - launcher.getDatabasePatchLevel() - 1;
099:                    log.info("Current number of unapplied patches is : "
100:                            + unappliedPatches);
101:                    log.info("The next patch to author should be     : "
102:                            + launcher.getNextPatchLevel());
103:                } catch (Exception e) {
104:                    log.error(e);
105:                    throw e;
106:                }
107:            }
108:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.