Index: trunk/PS-IPP-MetaDB/lib/PS/IPP/MetaDB.pm
===================================================================
--- trunk/PS-IPP-MetaDB/lib/PS/IPP/MetaDB.pm	(revision 5337)
+++ trunk/PS-IPP-MetaDB/lib/PS/IPP/MetaDB.pm	(revision 5338)
@@ -1,5 +1,5 @@
 # Copyright (C) 2005  Joshua Hoblitt
 #
-# $Id: MetaDB.pm,v 1.11 2005-10-14 23:47:46 jhoblitt Exp $
+# $Id: MetaDB.pm,v 1.12 2005-10-15 00:03:47 jhoblitt Exp $
 
 package PS::IPP::MetaDB;
@@ -118,14 +118,22 @@
     my %p = @_;
 
-    $class->search(
+    my $new = PS::IPP::MetaDB::Image::New->search(
         exp_id      => $p{exp_id},
+        class       => $p{class},
         class_id    => $p{class_id},
-    )->delete_all;
-
-    $class->create({
-        exp_id      => $p{exp_id},
-        class_id    => $p{class_id},
+    );
+
+    PS::IPP::MetaDB::Image::NotifyReceived->create({
+        file_id => $new->file_id,
+    });
+
+    PS::IPP::MetaDB::Image::Newed->create({
+        exp_id      => $new->exp_id,
+        class       => $new->class,
+        class_id    => $new->class_id,
         url         => $p{url},
     });
+
+    $new->delete;
 }
 
@@ -222,4 +230,35 @@
 }
 
+=item * notify_received
+
+This is a queue of pending file received notifications that need to be send to
+OTIS.  Once a notification is successfully sent to OTIS the entry is removed
+from this queue.
+
+=over 4
+
+=item * file_id
+
+OTIS's ID string for the file, i.e. it's filename.
+
+=back
+
+=cut
+
+package PS::IPP::MetaDB::Image::NotifyReceived;
+
+use base qw( PS::IPP::MetaDB );
+
+__PACKAGE__->register_init(\&init);
+
+sub init
+{
+    __PACKAGE__->table("notify_received");
+    __PACKAGE__->create_table(q{
+        file_id      BIGINT          NOT NULL PRIMARY KEY,
+    });
+    __PACKAGE__->set_up_table;
+}
+
 =item * metadata_new
 
@@ -483,4 +522,8 @@
 exposure ID #, keyed on the C<exposure_component> table.
 
+=item * class
+
+The 'type' of data this is.
+
 =item * class_id
 
@@ -506,4 +549,5 @@
     __PACKAGE__->create_table(q{
         exp_id      BIGINT          NOT NULL PRIMARY KEY,
+        class       VARCHAR(256)    NOT NULL,
         class_id    BIGINT          NOT NULL,
         url         VARCHAR(255)    NOT NULL
@@ -512,4 +556,5 @@
 }
 
+
 =item * prepared
 
