NAME

Astro::Catalog::Transport::REST - A base class for REST query modules

SYNOPSIS

use base qw/ Astro::Catalog::Transport::REST /;

DESCRIPTION

This class forms a base class for all the REST based query classes provided in the Astro::Catalog distribution (eg Astro::Catalog::Query::GSC).

METHODS

Constructor

new

Create a new instance from a hash of options

$q = new Astro::Catalog::Transport::REST( Coords    => new Astro::Coords(),
                                          Radius    => $radius,
                                          Bright    => $magbright,
                                          Faint     => $magfaint,
                                          Sort      => $sort_type,
                                          Number    => $number_out );

returns a reference to an query object. Must only called from sub-classed constructors.

RA and Dec are also allowed but are deprecated (since with only RA/Dec the coordinates must always be supplied as J2000 space-separated sexagesimal format).

useragent

The LWP user agent mediating the web transaction.

$ua = $q->useragent();

Created automatically the first time it is requested.

querydb

Returns an Astro::Catalog object resulting from the specific query.

$catalog = $q->querydb();
proxy

Return (or set) the current proxy for the catalog request.

$usno->proxy( 'http://wwwcache.ex.ac.uk:8080/' );
$proxy_url = $usno->proxy();
timeout

Return (or set) the current timeout in seconds for the request.

$usno->timeout( 30 );
$proxy_timeout = $usno->timeout();

Default is 30 seconds.

query_url

The URL formed to build up a query. Made up of a root host name (that can be set using the url method) and a fixed suffix that specifies the path to the service (CGI or otherwise). This query URL does not include the arguments to the CGI script (but will include the question mark if appropriate).

$query_url = $q->query();
$q->query_url( 'http://www.blah.org/cgi-bin/xxx.pl?');

Care must be taken when setting this value.

The argument is not validated. There may also need to be a new method that returns the full URL including arguments.

If no value has been supplied, a default will be returned.

url

Return the current remote host for the query (the full URL can be returned using the query_url method).

$host = $q->url();

Can also be used to set the root host for the URL (ie the machine name but no path component)

$q->url( "archive.eso.org" );

if not defined the default URL is used (specified in the sub class). This method should really be called remote_host.

Returns the default host name specified by the particular subclass if a value has not been defined.

agent

Returns the user agent tag sent by the module to the server.

$agent_tag = $q->agent();

The user agent tag can not be set by this method.