--- trunk/Estraier.pm 2006/01/05 15:01:56 25 +++ trunk/Estraier.pm 2006/01/05 15:33:48 30 @@ -659,6 +659,80 @@ } +package Search::Estraier::Node; + +use Carp qw/croak/; + +=head1 Search::Estraier::Node + +=head2 new + + my $node = new Search::HyperEstraier::Node; + +=cut + +sub new { + my $class = shift; + my $self = { + pxport => -1, + timeout => -1, + dnum => -1, + wnum => -1, + size => -1.0, + wwidth => 480, + hwidth => 96, + awidth => 96, + status => -1, + }; + bless($self, $class); + + $self ? return $self : return undef; +} + +=head2 set_url + +Specify URL to node server + + $node->set_url('http://localhost:1978'); + +=cut + +sub set_url { + my $self = shift; + $self->{url} = shift; +} + +=head2 set_proxy + +Specify proxy server to connect to node server + + $node->set_proxy('proxy.example.com', 8080); + +=cut + +sub set_proxy { + my $self = shift; + my ($host,$port) = @_; + croak "proxy port must be number" unless ($port =~ m/^\d+$/); + $self->{pxhost} = $host; + $self->{pxport} = $port; +} + +=head2 set_timeout + +Specify timeout of connection in seconds + + $node->set_timeout( 15 ); + +=cut + +sub set_timeout { + my $self = shift; + my $sec = shift; + croak "timeout must be number" unless ($sec =~ m/^\d+$/); + $self->{timeout} = $sec; +} + package Search::Estraier::Master; use Carp;