[Bps-public-commit] r17513 - Prophet/trunk/lib/Prophet

jesse at bestpractical.com jesse at bestpractical.com
Thu Jan 1 21:16:37 EST 2009


Author: jesse
Date: Thu Jan  1 21:16:37 2009
New Revision: 17513

Modified:
   Prophet/trunk/lib/Prophet/ReplicaExporter.pm

Log:
* Refactor the ReplicaExporter to make it easier to subclass


Modified: Prophet/trunk/lib/Prophet/ReplicaExporter.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/ReplicaExporter.pm	(original)
+++ Prophet/trunk/lib/Prophet/ReplicaExporter.pm	Thu Jan  1 21:16:37 2009
@@ -76,9 +76,8 @@
 sub export {
     my $self = shift;
 
-    $self->_init_export_metadata();
-    $self->export_records( type => $_ )
-        for ( @{ $self->source_replica->list_types } );
+    $self->init_export_metadata();
+    $self->export_all_records();
     $self->export_changesets();
 
     unless ($self->source_replica->is_resdb) {
@@ -92,7 +91,7 @@
     }
 }
 
-sub _init_export_metadata {
+sub init_export_metadata {
     my $self = shift;
     $self->target_replica->set_latest_sequence_no(
         $self->source_replica->latest_sequence_no );
@@ -100,6 +99,11 @@
 
 }
 
+sub export_all_records {
+    my $self = shift;
+    $self->export_records( type => $_ ) for ( @{ $self->source_replica->list_types } );
+}
+
 sub export_records {
     my $self = shift;
     my %args = validate( @_, { type => 1 } );



More information about the Bps-public-commit mailing list