[MOBY-dev] New method for discovering location of Moby Central

Mark Wilkinson markw at illuminae.com
Fri Nov 23 19:16:12 UTC 2007


Hi all,

Since we will be moving Moby Central in the next few days (it now passes  
all tests!) I thought it would also be a good time to design a more  
reliable way to discover the location of the registry than to hard-code it  
into the Perl and Java libraries.

I've set-up some redirects on http://biomoby.org as follows:

http://biomoby.org/mobycentral
http://biomoby.org/ontologyserver

these will give you a "301 Permamently Moved" with the "Location" header  
directing you to the default registry and ontology server respectively.

You can use this Perl code to get the locations if you need them, but I'll  
be adding this into the Perl client code (and asking eddie/martin to do  
the same for the Java stack) so probably you wont need to know the exact  
locations in most cases.

============================
#!perl -w
use LWP::UserAgent;
use HTTP::Request::Common qw(HEAD);

my $ua = LWP::UserAgent->new;
my $req = HEAD 'http://biomoby.org/mobycentral';
my $res = $ua->simple_request($req);
my $mobycentral = $res->header('location');
print "Default Moby Central is at: $mobycentral\n";

$req = HEAD 'http://biomoby.org/ontologyserver';
$res = $ua->simple_request($req);
my $ontologyserver = $res->header('location');
print "Default Moby Ontology Server is at: $ontologyserver\n";
================================



b.t.w.  if you are going to write code like this for yourself, PLEASE use  
the "simple_request" method, rather than the "request" method of LWP,  
since a simple_request does not automatically follow the 301 redirect  
(which then results in a 411 error in the registry error log)

This strikes me as being a more stable way of locating the registry in the  
long-term.  Any objections/comments?

b.t.w. if anyone wants to try the new Moby Central please use these new  
addresses, but DON'T use the new registry to do any production work yet,  
since I'll be wiping out and re-cloning the registry database when we "go  
live" next week.  The new registry currently is a clone of Moby Central as  
of 3 days ago.

Best wishes!

Mark


-- 
--
Mark Wilkinson
Assistant Professor, Dept. Medical Genetics
University of British Columbia
PI Bioinformatics
iCAPTURE Centre, St. Paul's Hospital
Tel:  604 682 2344 x62129
Fax:  604 806 9274

***CONFIDENTIALITY NOTICE***
This electronic message is intended only for the use of the addressee and  
may contain information that is privileged and confidential.  Any  
dissemination, distribution or copying of this communication by  
unauthorized individuals is strictly prohibited. If you have received this  
communication in error, please notify the sender immediately by reply  
e-mail and delete the original and all copies from your system.
 




More information about the MOBY-dev mailing list