661 |
|
|
662 |
package Search::Estraier::Node; |
package Search::Estraier::Node; |
663 |
|
|
664 |
|
use Carp qw/croak/; |
665 |
|
|
666 |
=head1 Search::Estraier::Node |
=head1 Search::Estraier::Node |
667 |
|
|
668 |
=head2 new |
=head2 new |
689 |
$self ? return $self : return undef; |
$self ? return $self : return undef; |
690 |
} |
} |
691 |
|
|
692 |
|
=head2 set_url |
693 |
|
|
694 |
|
Specify URL to node server |
695 |
|
|
696 |
|
$node->set_url('http://localhost:1978'); |
697 |
|
|
698 |
|
=cut |
699 |
|
|
700 |
|
sub set_url { |
701 |
|
my $self = shift; |
702 |
|
$self->{url} = shift; |
703 |
|
} |
704 |
|
|
705 |
|
=head2 set_proxy |
706 |
|
|
707 |
|
Specify proxy server to connect to node server |
708 |
|
|
709 |
|
$node->set_proxy('proxy.example.com', 8080); |
710 |
|
|
711 |
|
=cut |
712 |
|
|
713 |
|
sub set_proxy { |
714 |
|
my $self = shift; |
715 |
|
my ($host,$port) = @_; |
716 |
|
croak "proxy port must be number" unless ($port =~ m/^\d+$/); |
717 |
|
$self->{pxhost} = $host; |
718 |
|
$self->{pxport} = $port; |
719 |
|
} |
720 |
|
|
721 |
|
=head2 set_timeout |
722 |
|
|
723 |
|
Specify timeout of connection in seconds |
724 |
|
|
725 |
|
$node->set_timeout( 15 ); |
726 |
|
|
727 |
|
=cut |
728 |
|
|
729 |
|
sub set_timeout { |
730 |
|
my $self = shift; |
731 |
|
my $sec = shift; |
732 |
|
croak "timeout must be number" unless ($sec =~ m/^\d+$/); |
733 |
|
$self->{timeout} = $sec; |
734 |
|
} |
735 |
|
|
736 |
|
=head2 set_auth |
737 |
|
|
738 |
|
Specify name and password for authentication to node server. |
739 |
|
|
740 |
|
$node->set_auth('clint','eastwood'); |
741 |
|
|
742 |
|
=cut |
743 |
|
|
744 |
|
sub set_auth { |
745 |
|
my $self = shift; |
746 |
|
my ($login,$passwd) = @_; |
747 |
|
$self->{auth} = "$login:$passwd"; |
748 |
|
} |
749 |
|
|
750 |
package Search::Estraier::Master; |
package Search::Estraier::Master; |
751 |
|
|
752 |
use Carp; |
use Carp; |