.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::DB::GenericWebAgent 3pm" .TH Bio::DB::GenericWebAgent 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::DB::GenericWebAgent \- helper base class for parameter\-based remote server access and response retrieval. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # DO NOT USE DIRECTLY \& \& See Bio::DB::EUtilities for an example implementation .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1WARNING:\s0 Please do \fB\s-1NOT\s0\fR spam the web servers with multiple requests. .PP Bio::DB::GenericWebAgent is a generic wrapper around a web agent (LWP::UserAgent), an object which can retain, format, and build parameters for the user agent (Bio::ParameterBaseI), and a BioPerl class parser that processes response content received by the user agent. The Bio::ParameterBaseI object should be state-aware, e.g. know when changes occur to parameters, so that identical requests are not repeatedly sent to the server (this base class takes this into consideration). .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@lists.open\-bio.org \- General discussion \& http://bioperl.org/Support.html \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web. .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR" .IX Header "AUTHOR" Email cjfields at bioperl dot org .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "new" .IX Subsection "new" .Vb 7 \& Title : new \& Usage : Bio::DB::GenericWebAgent\->new(@args); \& Function: Create new Bio::DB::GenericWebAgent instance. \& Returns : \& Args : None specific to this base class. Inheriting classes will \& likely set specific parameters in their constructor; \& Bio::DB::GenericWebAgent is primarily a test bed. .Ve .SH "GenericWebAgent methods" .IX Header "GenericWebAgent methods" .SS "parameter_base" .IX Subsection "parameter_base" .Vb 5 \& Title : parameter_base \& Usage : $dbi\->parameter_base($pobj); \& Function: Get/Set Bio::ParameterBaseI. \& Returns : Bio::ParameterBaseI object \& Args : Bio::ParameterBaseI object .Ve .SS "ua" .IX Subsection "ua" .Vb 5 \& Title : ua \& Usage : $dbi\->ua; \& Function: Get/Set LWP::UserAgent. \& Returns : LWP::UserAgent \& Args : LWP::UserAgent .Ve .SS "get_Response" .IX Subsection "get_Response" .Vb 6 \& Title : get_Response \& Usage : $agent\->get_Response; \& Function: Get the HTTP::Response object by passing it an HTTP::Request (generated from \& Bio::ParameterBaseI implementation). \& Returns : HTTP::Response object or data if callback is used \& Args : (optional) \& \& \-cache_response \- flag to cache HTTP::Response object; \& Default is 1 (TRUE, caching ON) \& \& These are passed on to LWP::UserAgent::request() if stipulated \& \& \-cb \- use a LWP::UserAgent\-compliant callback \& \-file \- dumps the response to a file (handy for large responses) \& Note: can\*(Aqt use file and callback at the same time \& \-read_size_hint \- bytes of content to read in at a time to pass to callback \& Note : Caching and parameter checking are set .Ve .SS "get_Parser" .IX Subsection "get_Parser" .Vb 6 \& Title : get_Parser \& Usage : $agent\->get_Parser; \& Function: Return HTTP::Response content (file, fh, object) attached to defined parser \& Returns : None \& Args : None \& Note : Abstract method; defined by implementation .Ve .SS "delay" .IX Subsection "delay" .Vb 5 \& Title : delay \& Usage : $secs = $self\->delay($secs) \& Function: get/set number of seconds to delay between fetches \& Returns : number of seconds to delay \& Args : new value .Ve .PP \&\s-1NOTE:\s0 the default is to use the value specified by \fBdelay_policy()\fR. This can be overridden by calling this method. .SS "delay_policy" .IX Subsection "delay_policy" .Vb 5 \& Title : delay_policy \& Usage : $secs = $self\->delay_policy \& Function: return number of seconds to delay between calls to remote db \& Returns : number of seconds to delay \& Args : none .Ve .PP \&\s-1NOTE:\s0 The default delay policy is 3s. Override in subclasses to implement delays. The timer has only second resolution, so the delay will actually be +/\- 1s. .SS "_sleep" .IX Subsection "_sleep" .Vb 5 \& Title : _sleep \& Usage : $self\->_sleep \& Function: sleep for a number of seconds indicated by the delay policy \& Returns : none \& Args : none .Ve .PP \&\s-1NOTE:\s0 This method keeps track of the last time it was called and only imposes a sleep if it was called more recently than the \fBdelay_policy()\fR allows. .SH "LWP::UserAgent related methods" .IX Header "LWP::UserAgent related methods" .SS "proxy" .IX Subsection "proxy" .Vb 9 \& Title : proxy \& Usage : $httpproxy = $db\->proxy(\*(Aqhttp\*(Aq) or \& $db\->proxy([\*(Aqhttp\*(Aq,\*(Aqftp\*(Aq], \*(Aqhttp://myproxy\*(Aq ) \& Function: Get/Set a proxy for use of proxy \& Returns : a string indicating the proxy \& Args : $protocol : an array ref of the protocol(s) to set/get \& $proxyurl : url of the proxy to use for the specified protocol \& $username : username (if proxy requires authentication) \& $password : password (if proxy requires authentication) .Ve .SS "authentication" .IX Subsection "authentication" .Vb 5 \& Title : authentication \& Usage : $db\->authentication($user,$pass) \& Function: Get/Set authentication credentials \& Returns : Array of user/pass \& Args : Array or user/pass .Ve