The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::DB::GenericWebDBI - abstract interface for parameter-based remote database access

SYNOPSIS

  #
  # grab data from HTTP::Response object using concrete class
  #

  $data = $db->get_response->content;

  #
  # $data is the raw data output from the HTTP::Response object;
  # this data may be preparsed using the private method _parse_response

DESCRIPTION

WARNING: Please do NOT spam the web servers with multiple requests.

This class acts as a user agent interface for any generic web database, but is specifically geared towards CGI-based databases which accept parameters.

TODO

File and filehandle support to be added

Any feedback is welcome.

FEEDBACK

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.

  bioperl-l@lists.open-bio.org               - General discussion
  http://www.bioperl.org/wiki/Mailing_lists  - About the mailing lists

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.

  http://bugzilla.open-bio.org/

AUTHOR

Email cjfields at uiuc dot edu

APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

url_base_address

 Title   : url_base_address
 Usage   : my $address = $self->url_base_address or
           $self->url_base_address($address)
 Function: Get/Set the base URL for the Web Database
 Returns : Base URL for the Web Database
 Args    : $address - URL for the WebDatabase

proxy

 Title   : proxy
 Usage   : $httpproxy = $db->proxy('http')  or
           $db->proxy(['http','ftp'], 'http://myproxy' )
 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)

authentication

 Title   : authentication
 Usage   : $db->authentication($user,$pass)
 Function: Get/Set authentication credentials
 Returns : Array of user/pass
 Args    : Array or user/pass

db

 Title   : db
 Usage   : $db->db
 Function: Get/Set database parameter
 Returns : string
 Args    : optional string

id

 Title   : id
 Usage   : $agent->id($id)
           $agent->id(\@id)
 Function: Get/Set id(s)
 Returns : reference to id(s)
 Args    : a single id or reference to array of id(s)

retmode

 Title   : retmode
 Usage   : $agent->retmode($mode)
 Function: Get/Set return mode for query (text, xml, html, asn.1, etc)
 Returns : string for return mode
 Args    : optional string

get_response

 Title   : get_response
 Usage   : $agent->get_response;
 Function: get the request based on set object parameters, retrieved using
           the private method _get_params
 Returns : HTTP::Response object
 Args    : none

 This is implemented by the derived class

delay

 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

NOTE: the default is to use the value specified by delay_policy(). This can be overridden by calling this method, or by passing the -delay argument to new().

delay_policy

 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

NOTE: The default delay policy is 0s. Override in subclasses to implement delays. The timer has only second resolution, so the delay will actually be +/- 1s.

_submit_request

  Title   : _submit_request
  Usage   : my $url = $self->get_request
  Function: builds request object based on set parameters
  Returns : HTTP::Request
  Args    : optional : Bio::DB::EUtilities cookie

_get_params

  Title   : _get_params
  Usage   : my $url = $self->_get_params
  Function: builds parameter list for web request
  Returns : hash of parameter-value paris
  Args    : optional : Bio::DB::EUtilities cookie

_sleep

 Title   : _sleep
 Usage   : $self->_sleep
 Function: sleep for a number of seconds indicated by the delay policy
 Returns : none
 Args    : none

NOTE: This method keeps track of the last time it was called and only imposes a sleep if it was called more recently than the delay_policy() allows.