[Bps-public-commit] r11543 - SVN-PropDB/lib/Prophet/Replica

clkao at bestpractical.com clkao at bestpractical.com
Sat Apr 5 17:59:13 EDT 2008


Author: clkao
Date: Sat Apr  5 17:58:55 2008
New Revision: 11543

Modified:
   SVN-PropDB/lib/Prophet/Replica/RT.pm

Log:
use metadata storage api for remote_id in Replica::RT.

Modified: SVN-PropDB/lib/Prophet/Replica/RT.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica/RT.pm	(original)
+++ SVN-PropDB/lib/Prophet/Replica/RT.pm	Sat Apr  5 17:58:55 2008
@@ -207,29 +207,25 @@
 
 sub _lookup_remote_id {
     my $self = shift;
-    my ($id) = validate_pos(@_, 1);
-    
-    my $remote_id = Prophet::Record->new( handle => $self->state_handle, type => $REMOTE_ID_METATYPE);
-    $remote_id->load(uuid => $self->uuid_for_url( $self->rt_url . "/ticket/$id" ));
-    return eval {$remote_id->prop('prophet-uuid')};
-}
+    my ($id) = validate_pos( @_, 1 );
 
+    return $self->state_handle->_retrieve_metadata_for(
+        $REMOTE_ID_METATYPE,
+        $self->uuid_for_url( $self->rt_url . "/ticket/$id" ),
+        'prophet-uuid' );
+}
 
 sub _set_remote_id {
     my $self = shift;
-    my %args = validate(
-        @_,
-        {   uuid      => 1,
-            remote_id => 1
+    my %args = validate( @_,
+        { uuid      => 1,
+          remote_id => 1
         }
-            );
-    $self->state_handle->create_node( uuid => $self->uuid_for_url( $self->rt_url . "/ticket/".$args{'remote_id'} ),
-                                     type => $REMOTE_ID_METATYPE, props => {
-                                            'prophet-uuid' => $args{'uuid'}
-                                    
-                                    
-                                           } ) 
-
+    );
+    return $self->state_handle->_record_metadata_for(
+        $REMOTE_ID_METATYPE,
+        $self->uuid_for_url( $self->rt_url . "/ticket/" . $args{'remote_id'} ),
+        'prophet-uuid' => $args{uuid} );
 }
 
 



More information about the Bps-public-commit mailing list