New
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Task / Retrieve.pm
1 # $Id: Retrieve.pm,v 1.1 2006-10-25 15:45:29 mike Exp $
2
3 package ZOOM::IRSpy::Task::Retrieve;
4
5 use 5.008;
6 use strict;
7 use warnings;
8
9 use ZOOM::IRSpy::Task;
10 our @ISA = qw(ZOOM::IRSpy::Task);
11
12 =head1 NAME
13
14 ZOOM::IRSpy::Task::Retrieve - a searching task for IRSpy
15
16 =head1 SYNOPSIS
17
18  ## to follow
19
20 =head1 DESCRIPTION
21
22  ## to follow
23
24 =cut
25
26 sub new {
27     my $class = shift();
28     my($rs) = shift();
29     my($index0) = shift();
30
31     my $this = $class->SUPER::new(@_);
32     $this->{rs} = $rs;
33     $this->{index0} = $index0;
34     return $this;
35 }
36
37 sub run {
38     my $this = shift();
39
40     $this->set_options();
41
42     my $conn = $this->conn();
43     my $rs = $this->{rs};
44     my $index0 = $this->{index0};
45     $this->irspy()->log("irspy_task", $conn->option("host"),
46                         " retrieving record $index0 from $rs");
47     $rs->records($index0, 1, 0); # requests record
48
49     $this->set_options();
50 }
51
52 sub render {
53     my $this = shift();
54     return ref($this) . "(" . $this->{rs}. ", " . $this->{index0} . ")";
55 }
56
57 use overload '""' => \&render;
58
59
60 =head1 SEE ALSO
61
62 ZOOM::IRSpy
63
64 =head1 AUTHOR
65
66 Mike Taylor, E<lt>mike@indexdata.comE<gt>
67
68 =head1 COPYRIGHT AND LICENSE
69
70 Copyright (C) 2006 by Index Data ApS.
71
72 This library is free software; you can redistribute it and/or modify
73 it under the same terms as Perl itself, either Perl version 5.8.7 or,
74 at your option, any later version of Perl 5 you may have available.
75
76 =cut
77
78 1;