You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2010/06/29 07:57:19 UTC

svn commit: r958833 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-capability/ components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/ components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/...

Author: rwatler
Date: Tue Jun 29 05:57:19 2010
New Revision: 958833

URL: http://svn.apache.org/viewvc?rev=958833&view=rev
Log:
Jetspeed Migration: allow registry to drop preferences w/o existing entity and report dropped migation rows

Added:
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResult.java
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/migration/
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResultImpl.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-capability/pom.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/JetspeedCapabilitiesMigration.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationApplication.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/tools/migration/JetspeedDBPageManagerMigration.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/tools/migration/JetspeedProfilerMigration.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/tools/migration/JetspeedRegistryMigration.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSecurityMigration.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/pom.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSSOSecurityMigration.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/pom.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/src/main/java/org/apache/jetspeed/tools/migration/JetspeedStatisticsMigration.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigration.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-capability/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-capability/pom.xml?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-capability/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-capability/pom.xml Tue Jun 29 05:57:19 2010
@@ -49,6 +49,11 @@
     </dependency>
     <dependency>
       <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-commons</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
       <artifactId>jetspeed-rdbms</artifactId>
     </dependency>
     <dependency>
@@ -149,4 +154,4 @@
     </testResources>
   </build>
 
-</project>
\ No newline at end of file
+</project>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/JetspeedCapabilitiesMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/JetspeedCapabilitiesMigration.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/JetspeedCapabilitiesMigration.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-capability/src/main/java/org/apache/jetspeed/tools/migration/JetspeedCapabilitiesMigration.java Tue Jun 29 05:57:19 2010
@@ -50,7 +50,7 @@ public class JetspeedCapabilitiesMigrati
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         int rowsMigrated = 0;
         
@@ -209,6 +209,6 @@ public class JetspeedCapabilitiesMigrati
         ojbQueryStatement.close();
         ojbInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated);
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationApplication.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationApplication.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationApplication.java Tue Jun 29 05:57:19 2010
@@ -237,8 +237,15 @@ public class JetspeedMigrationApplicatio
         for (JetspeedMigration migration : migrations)
         {
             log.info("Migrating "+migration.getName()+" data...");
-            int rowsMigrated = migration.migrate(sourceConnection, sourceVersion, targetConnection);
-            log.info("Migrated "+rowsMigrated+" "+migration.getName()+" data rows.");
+            JetspeedMigrationResult result = migration.migrate(sourceConnection, sourceVersion, targetConnection);
+            if (result.getDroppedRows() == 0)
+            {
+                log.info("Migrated "+result.getMigratedRows()+" "+migration.getName()+" data rows.");
+            }
+            else
+            {
+                log.info("Migrated "+result.getMigratedRows()+" "+migration.getName()+" data rows, ("+result.getDroppedRows()+" dropped).");
+            }
         }
 
         // add constraints and remaining schema to target database

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/tools/migration/JetspeedDBPageManagerMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/tools/migration/JetspeedDBPageManagerMigration.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/tools/migration/JetspeedDBPageManagerMigration.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/tools/migration/JetspeedDBPageManagerMigration.java Tue Jun 29 05:57:19 2010
@@ -77,7 +77,7 @@ public class JetspeedDBPageManagerMigrat
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         int rowsMigrated = 0;
         
@@ -962,6 +962,6 @@ public class JetspeedDBPageManagerMigrat
         ojbQueryStatement.close();
         ojbInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated);
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/tools/migration/JetspeedProfilerMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/tools/migration/JetspeedProfilerMigration.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/tools/migration/JetspeedProfilerMigration.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/tools/migration/JetspeedProfilerMigration.java Tue Jun 29 05:57:19 2010
@@ -50,7 +50,7 @@ public class JetspeedProfilerMigration i
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         int rowsMigrated = 0;
         
@@ -143,6 +143,6 @@ public class JetspeedProfilerMigration i
         ojbQueryStatement.close();
         ojbInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated);
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/tools/migration/JetspeedRegistryMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/tools/migration/JetspeedRegistryMigration.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/tools/migration/JetspeedRegistryMigration.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/tools/migration/JetspeedRegistryMigration.java Tue Jun 29 05:57:19 2010
@@ -68,10 +68,11 @@ public class JetspeedRegistryMigration i
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         List<LocalizedDescription> localizedDescriptions = new ArrayList<LocalizedDescription>();
         int rowsMigrated = 0;
+        int rowsDropped = 0;
         
         // PORTLET_DEFINITION
         PreparedStatement portletDefinitionInsertStatement = targetConnection.prepareStatement("INSERT INTO PORTLET_DEFINITION (ID, NAME, CLASS_NAME, APPLICATION_ID, EXPIRATION_CACHE, RESOURCE_BUNDLE, PREFERENCE_VALIDATOR, SECURITY_REF, CACHE_SCOPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
@@ -429,10 +430,6 @@ public class JetspeedRegistryMigration i
                                     applicationName = portletEntityResultSet.getString(1);
                                     portletName = portletEntityResultSet.getString(2);
                                 }
-                                else
-                                {
-                                    throw new SQLException("Unable to find portlet entity for id: "+entityId);
-                                }
                                 portletEntityResultSet.close();
                             }
                         }
@@ -474,6 +471,10 @@ public class JetspeedRegistryMigration i
                             portletPreferenceInsertStatement.executeUpdate();
                             rowsMigrated++;                            
                         }
+                        else
+                        {
+                            rowsDropped++;
+                        }
                     }
                 }
                 readOnlyQueryStatement.close();
@@ -1358,7 +1359,7 @@ public class JetspeedRegistryMigration i
         }
         ojbInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated, rowsDropped);
     }
     
     /**

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSecurityMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSecurityMigration.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSecurityMigration.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSecurityMigration.java Tue Jun 29 05:57:19 2010
@@ -70,7 +70,7 @@ public class JetspeedSecurityMigration i
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         int rowsMigrated = 0;
         
@@ -674,7 +674,7 @@ public class JetspeedSecurityMigration i
         }
         ojbInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated);
     }
     
     /**

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/pom.xml?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/pom.xml Tue Jun 29 05:57:19 2010
@@ -47,6 +47,11 @@
     </dependency>
     <dependency>
       <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-commons</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
       <artifactId>jetspeed-rdbms</artifactId>
     </dependency>
     <dependency>
@@ -66,11 +71,6 @@
     <!-- Test Dependencies -->
     <dependency>
       <groupId>${pom.groupId}</groupId>
-      <artifactId>jetspeed-commons</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>${pom.groupId}</groupId>
       <artifactId>jetspeed-file-cache</artifactId>
       <scope>test</scope>
     </dependency>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSSOSecurityMigration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSSOSecurityMigration.java?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSSOSecurityMigration.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/main/java/org/apache/jetspeed/tools/migration/JetspeedSSOSecurityMigration.java Tue Jun 29 05:57:19 2010
@@ -60,7 +60,7 @@ public class JetspeedSSOSecurityMigratio
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         int rowsMigrated = 0;
         
@@ -154,6 +154,6 @@ public class JetspeedSSOSecurityMigratio
         ojbQueryStatement.close();
         ojbInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated);
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/pom.xml?rev=958833&r1=958832&r2=958833&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-statistics/pom.xml Tue Jun 29 05:57:19 2010
@@ -47,6 +47,11 @@
     </dependency>
     <dependency>
       <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-commons</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
       <artifactId>jetspeed-rdbms</artifactId>
     </dependency>
     <dependency>

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=958833&r1=958832&r2=958833&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 Tue Jun 29 05:57:19 2010
@@ -50,7 +50,7 @@ public class JetspeedStatisticsMigration
     /* (non-Javadoc)
      * @see org.apache.jetspeed.tools.migration.JetspeedMigration#migrate(java.sql.Connection, int, java.sql.Connection)
      */
-    public int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
+    public JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException
     {
         int rowsMigrated = 0;
                 
@@ -172,6 +172,6 @@ public class JetspeedStatisticsMigration
         userActivityQueryStatement.close();
         userActivityInsertStatement.close();
         
-        return rowsMigrated;
+        return new JetspeedMigrationResultImpl(rowsMigrated);
     }
 }

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=958833&r1=958832&r2=958833&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 Tue Jun 29 05:57:19 2010
@@ -67,10 +67,10 @@ public interface JetspeedMigration
      * @param sourceConnection connection to source database
      * @param sourceVersion source version
      * @param targetConnection connection to target database
-     * @return database rows migrated
+     * @return migration result
      * @throws SQLException on SQL error or version incompatibility
      */
-    int migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException;
+    JetspeedMigrationResult migrate(Connection sourceConnection, int sourceVersion, Connection targetConnection) throws SQLException;
 
     /**
      * Static utility functions class.

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResult.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResult.java?rev=958833&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResult.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResult.java Tue Jun 29 05:57:19 2010
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+/**
+ * Jetspeed Migration Result interface.
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public interface JetspeedMigrationResult
+{
+    /**
+     * Get migrated row count.
+     * 
+     * @return count
+     */
+    int getMigratedRows();
+
+    /**
+     * Get dropped row count.
+     * 
+     * @return count
+     */
+    int getDroppedRows();
+}

Added: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResultImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResultImpl.java?rev=958833&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResultImpl.java (added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/tools/migration/JetspeedMigrationResultImpl.java Tue Jun 29 05:57:19 2010
@@ -0,0 +1,68 @@
+/*
+ * 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;
+
+/**
+ * Jetspeed Migration Result implementation.
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+public class JetspeedMigrationResultImpl implements JetspeedMigrationResult
+{
+    private final int migratedRows;
+    private final int droppedRows;
+    
+    /**
+     * Constructor accepting migrated rows counts.
+     * 
+     * @param migratedRows migrated rows count
+     */
+    public JetspeedMigrationResultImpl(int migratedRows)
+    {
+        this.migratedRows = migratedRows;
+        this.droppedRows = 0;
+    }
+
+    /**
+     * Constructor accepting migrated and dropped rows counts.
+     * 
+     * @param migratedRows migrated rows count
+     * @param droppedRows dropped rows count
+     */
+    public JetspeedMigrationResultImpl(int migratedRows, int droppedRows)
+    {
+        this.migratedRows = migratedRows;
+        this.droppedRows = droppedRows;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.tools.migration.JetspeedMigrationResult#getDroppedRows()
+     */
+    public int getDroppedRows()
+    {
+        return droppedRows;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.tools.migration.JetspeedMigrationResult#getMigratedRows()
+     */
+    public int getMigratedRows()
+    {
+        return migratedRows;
+    }
+}



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