portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r996614 [2/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/ components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/ components/jetspeed-page-...
Date Mon, 13 Sep 2010 17:47:49 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/main/java/org/apache/jetspeed/tools/migration/JetspeedStatisticsMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/main/java/org/apache/jetspeed/tools/migration/JetspeedStatisticsMigration.java?rev=996614&r1=996613&r2=996614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/main/java/org/apache/jetspeed/tools/migration/JetspeedStatisticsMigration.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/main/java/org/apache/jetspeed/tools/migration/JetspeedStatisticsMigration.java
Mon Sep 13 17:47:49 2010
@@ -48,9 +48,9 @@ public class JetspeedStatisticsMigration
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection,
int, java.sql.Connection)
+     * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection,
int, java.sql.Connection, org.apache.jetspeed.tools.migration.JetspeedMigrationListener)
      */
-    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion,
Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion,
Connection targetConnection, JetspeedMigrationListener migrationListener) throws SQLException
     {
         int rowsMigrated = 0;
                 
@@ -81,6 +81,7 @@ public class JetspeedStatisticsMigration
             Static.setNullableLong(portletStatisticsResultSet, 7, portletStatisticsInsertStatement);
             portletStatisticsInsertStatement.executeUpdate();
             rowsMigrated++;
+            migrationListener.rowMigrated(targetConnection);
         }
         portletStatisticsResultSet.close();
         portletStatisticsQueryStatement.close();
@@ -101,6 +102,7 @@ public class JetspeedStatisticsMigration
             Static.setNullableLong(pageStatisticsResultSet, 6, pageStatisticsInsertStatement);
             pageStatisticsInsertStatement.executeUpdate();
             rowsMigrated++;
+            migrationListener.rowMigrated(targetConnection);
         }
         pageStatisticsResultSet.close();
         pageStatisticsQueryStatement.close();
@@ -120,6 +122,7 @@ public class JetspeedStatisticsMigration
             Static.setNullableLong(userStatisticsResultSet, 5, userStatisticsInsertStatement);
             userStatisticsInsertStatement.executeUpdate();
             rowsMigrated++;
+            migrationListener.rowMigrated(targetConnection);
         }
         userStatisticsResultSet.close();
         userStatisticsQueryStatement.close();
@@ -144,6 +147,7 @@ public class JetspeedStatisticsMigration
             adminActivityInsertStatement.setString(10, adminActivityResultSet.getString(10));
             adminActivityInsertStatement.executeUpdate();
             rowsMigrated++;
+            migrationListener.rowMigrated(targetConnection);
         }
         adminActivityResultSet.close();
         adminActivityQueryStatement.close();
@@ -167,6 +171,7 @@ public class JetspeedStatisticsMigration
             userActivityInsertStatement.setString(9, userActivityResultSet.getString(9));
             userActivityInsertStatement.executeUpdate();
             rowsMigrated++;
+            migrationListener.rowMigrated(targetConnection);
         }
         userActivityResultSet.close();
         userActivityQueryStatement.close();

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigration.java?rev=996614&r1=996613&r2=996614&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigration.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigration.java
Mon Sep 13 17:47:49 2010
@@ -67,10 +67,11 @@ public interface JetspeedMigration
      * @param sourceConnection connection to source database
      * @param sourceVersion source version
      * @param targetConnection connection to target database
+     * @param migrationListener migration listener
      * @return migration result
      * @throws SQLException on SQL error or version incompatibility
      */
-    JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection
targetConnection) throws SQLException;
+    JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection
targetConnection, JetspeedMigrationListener migrationListener) throws SQLException;
 
     /**
      * Static utility functions class.

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationListener.java?rev=996614&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationListener.java
(added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationListener.java
Mon Sep 13 17:47:49 2010
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.tools.migration;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+/**
+ * Jetspeed Migration Listener interface.
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public interface JetspeedMigrationListener
+{
+    /**
+     * Notify listener that row has been migrated to target.
+     * 
+     * @param targetConnection
+     */
+    void rowMigrated(Connection targetConnection) throws SQLException;
+
+    /**
+     * Notify listener that row has been dropped from migration.
+     * 
+     * @param targetConnection
+     */
+    void rowDropped(Connection targetConnection) throws SQLException;
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message