X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FConnection.pm;h=0e32c8be37f687519c25e0aefc550ea3503e0e7d;hp=656bd3b590849b16c4d905bdb5f6b87ec83f697d;hb=e04a51eb8137d29b22ff514f4c226192fbd530b8;hpb=325dcc4a37a98670368e8de907bbdbe703012456 diff --git a/lib/ZOOM/IRSpy/Connection.pm b/lib/ZOOM/IRSpy/Connection.pm index 656bd3b..0e32c8b 100644 --- a/lib/ZOOM/IRSpy/Connection.pm +++ b/lib/ZOOM/IRSpy/Connection.pm @@ -1,4 +1,4 @@ -# $Id: Connection.pm,v 1.3 2006-10-12 14:35:43 mike Exp $ +# $Id: Connection.pm,v 1.7 2006-11-16 17:18:43 mike Exp $ package ZOOM::IRSpy::Connection; @@ -11,6 +11,7 @@ our @ISA = qw(ZOOM::Connection); use ZOOM::IRSpy::Task::Connect; use ZOOM::IRSpy::Task::Search; +use ZOOM::IRSpy::Task::Retrieve; =head1 NAME @@ -73,7 +74,7 @@ sub current_task { my $old = $this->{current_task}; if (defined $new) { $this->{current_task} = $new; - $this->log("irspy_debug", "set current task to $new"); + $this->log("irspy_task", "set current task to $new"); } return $old; @@ -87,7 +88,7 @@ sub next_task { my $old = $this->{next_task}; if (defined $new) { $this->{next_task} = $new; - $this->log("irspy_debug", "set next task to $new"); + $this->log("irspy_task", "set next task to $new"); } return $old; @@ -104,21 +105,30 @@ sub log { sub irspy_connect { my $this = shift(); - my($udata, %cb) = @_; + my($udata, $options, %cb) = @_; - my $task = new ZOOM::IRSpy::Task::Connect($this, $udata, %cb); + my $task = new ZOOM::IRSpy::Task::Connect($this, $udata, $options, %cb); $this->add_task($task); - $this->log("irspy", "registered connect()"); } sub irspy_search_pqf { my $this = shift(); - my($query, $udata, %cb) = @_; + my($query, $udata, $options, %cb) = @_; - my $task = new ZOOM::IRSpy::Task::Search($query, $this, $udata, %cb); + my $task = new ZOOM::IRSpy::Task::Search($query, + $this, $udata, $options, %cb); + $this->add_task($task); +} + + +sub irspy_rs_record { + my $this = shift(); + my($rs, $index0, $udata, $options, %cb) = @_; + + my $task = new ZOOM::IRSpy::Task::Retrieve($rs, $index0, + $this, $udata, $options, %cb); $this->add_task($task); - $this->log("irspy", "registered search_pqf($query)"); } @@ -129,10 +139,18 @@ sub add_task { my $tasks = $this->{tasks}; $tasks->[-1]->{next} = $task if @$tasks > 0; push @$tasks, $task; - $this->log("irspy", "added task $task"); + $this->log("irspy_task", "added task $task"); } +sub render { + my $this = shift(); + return ref($this) . "(" . $this->option("host") . ")"; +} + +use overload '""' => \&render; + + =head1 SEE ALSO ZOOM::IRSpy