Skip to content

Commit

Permalink
vo: generalise registry access for use with multiple implementations
Browse files Browse the repository at this point in the history
RegistryQuery is now an interface.  The previous implementation,
which works using the SOAP-based IVOA Registry Interface 1.0 standard,
is renamed as the concrete subclass Ri1RegistryQuery.
This opens the way for alternative RegistryQuery implementations,
so I can use the same framework for RegTAP registry queries.

Some of the other classes still need changes to work with different
implementations, which will be done in future revisions.

The RegistryQueryPanel and RegistryTableLoadDialog however
have been renamed as Ri1*, since I don't intend to update those
to use RegTAP - they would need a lot of changes, and if you want
to do free-form queries of a RegTAP registry you can use the TAP
load dialogue rather than needing a specific one like these.
  • Loading branch information
mbtaylor authored and mmpcn committed Nov 27, 2014
1 parent eb173f4 commit f3abfb2
Show file tree
Hide file tree
Showing 15 changed files with 368 additions and 321 deletions.
Expand Up @@ -21,7 +21,9 @@
import uk.ac.starlink.table.TableSequence;
import uk.ac.starlink.table.Tables;
import uk.ac.starlink.table.gui.TableLoader;
import uk.ac.starlink.vo.RegistryTableLoadDialog;
import uk.ac.starlink.vo.RegResource;
//import uk.ac.starlink.vo.RegistryQuery;
import uk.ac.starlink.vo.Ri1RegistryTableLoadDialog;

/**
* Dialog for performing a simple query on a registry for its SSAP servers.
Expand All @@ -34,7 +36,7 @@
* @version $Id: SSARegistryQueryDialog.java 9052 2009-12-09 18:48:37Z mbt $
*/
public class SSARegistryQueryDialog
extends RegistryTableLoadDialog
extends Ri1RegistryTableLoadDialog
{
private SSAPRegistryQueryPanel rqPanel_;
private static Boolean available_;
Expand Down
1 change: 0 additions & 1 deletion topcat/src/main/uk/ac/starlink/topcat/ControlWindow.java
Expand Up @@ -134,7 +134,6 @@
import uk.ac.starlink.util.gui.StringPaster;
import uk.ac.starlink.vo.ConeSearchDialog;
import uk.ac.starlink.vo.DalTableLoadDialog;
import uk.ac.starlink.vo.RegistryTableLoadDialog;
import uk.ac.starlink.vo.SiapTableLoadDialog;
import uk.ac.starlink.vo.SkyDalTableLoadDialog;
import uk.ac.starlink.vo.SkyPositionEntry;
Expand Down
6 changes: 3 additions & 3 deletions topcat/src/main/uk/ac/starlink/topcat/LoadWindow.java
Expand Up @@ -37,7 +37,7 @@
import uk.ac.starlink.topcat.contrib.basti.BaSTITableLoadDialog;
import uk.ac.starlink.topcat.contrib.gavo.GavoTableLoadDialog;
import uk.ac.starlink.topcat.vizier.VizierTableLoadDialog;
import uk.ac.starlink.vo.RegistryTableLoadDialog;
import uk.ac.starlink.vo.Ri1RegistryTableLoadDialog;
import uk.ac.starlink.util.Loader;
import uk.ac.starlink.util.gui.ErrorDialog;
import uk.ac.starlink.util.gui.ShrinkWrapper;
Expand Down Expand Up @@ -73,7 +73,7 @@ public class LoadWindow extends AuxWindow {
TopcatSiapTableLoadDialog.class.getName(),
TopcatSsapTableLoadDialog.class.getName(),
TopcatTapTableLoadDialog.class.getName(),
RegistryTableLoadDialog.class.getName(),
Ri1RegistryTableLoadDialog.class.getName(),
VizierTableLoadDialog.class.getName(),
GavoTableLoadDialog.class.getName(),
BaSTITableLoadDialog.class.getName(),
Expand Down Expand Up @@ -153,7 +153,7 @@ public TableLoader createTableLoader() {

/* Add actions to toolbar. */
List<Action> toolList = new ArrayList<Action>( actList_ );
toolList.remove( getDialogAction( RegistryTableLoadDialog.class ) );
toolList.remove( getDialogAction( Ri1RegistryTableLoadDialog.class ) );
toolList.remove( getDialogAction( FileChooserTableLoadDialog.class ) );
toolList.remove( getDialogAction( LocationTableLoadDialog.class ) );
for ( Action act : toolList ) {
Expand Down
4 changes: 2 additions & 2 deletions topcat/src/main/uk/ac/starlink/topcat/ResourceIcon.java
Expand Up @@ -41,7 +41,7 @@
import uk.ac.starlink.ttools.plot.ErrorMode;
import uk.ac.starlink.util.IconUtils;
import uk.ac.starlink.vo.ConeSearchDialog;
import uk.ac.starlink.vo.RegistryTableLoadDialog;
import uk.ac.starlink.vo.Ri1RegistryTableLoadDialog;
import uk.ac.starlink.vo.SiapTableLoadDialog;
import uk.ac.starlink.vo.SsapTableLoadDialog;
import uk.ac.starlink.vo.TapTableLoadDialog;
Expand Down Expand Up @@ -621,7 +621,7 @@ private static Map getDiyIconMap() {
nameMap.put( "TAP_DIALOG",
new TapTableLoadDialog().getIcon() );
nameMap.put( "REGISTRY_DIALOG",
new RegistryTableLoadDialog().getIcon() );
new Ri1RegistryTableLoadDialog().getIcon() );
nameMap.put( "HELP_TOC",
new ImageIcon( JHelp.class
.getResource( "plaf/basic/images/toc.gif" ) ) );
Expand Down
14 changes: 7 additions & 7 deletions ttools/src/main/uk/ac/starlink/ttools/task/RegQuery.java
Expand Up @@ -13,7 +13,7 @@
import uk.ac.starlink.task.TaskException;
import uk.ac.starlink.task.URLParameter;
import uk.ac.starlink.util.Destination;
import uk.ac.starlink.vo.RegistryQuery;
import uk.ac.starlink.vo.Ri1RegistryQuery;
import uk.ac.starlink.vo.RegistryStarTable;

/**
Expand Down Expand Up @@ -71,15 +71,15 @@ public RegQuery() {

urlParam_ = new URLParameter( "regurl" );
urlParam_.setPrompt( "URL of registry service" );
urlParam_.setDefault( RegistryQuery.AG_REG );
urlParam_.setDefault( Ri1RegistryQuery.AG_REG );
urlParam_.setDescription( new String[] {
"<p>The URL of a SOAP endpoint which provides",
"a VOResource1.0 IVOA registry service.",
"Some known suitable registry endpoints at time of writing are",
"<ul>",
"<li><code>" + RegistryQuery.AG_REG + "</code></li>",
"<li><code>" + RegistryQuery.EUROVO_REG + "</code></li>",
"<li><code>" + RegistryQuery.NVO_REG + "</code></li>",
"<li><code>" + Ri1RegistryQuery.AG_REG + "</code></li>",
"<li><code>" + Ri1RegistryQuery.EUROVO_REG + "</code></li>",
"<li><code>" + Ri1RegistryQuery.NVO_REG + "</code></li>",
"</ul>",
"</p>",
} );
Expand Down Expand Up @@ -117,8 +117,8 @@ public StarTable getTable() throws TaskException {
if ( soapdest != null ) {
soapClient.setEchoStream( soapdest.createStream() );
}
RegistryQuery query =
new RegistryQuery( soapClient, qText );
Ri1RegistryQuery query =
new Ri1RegistryQuery( soapClient, qText );
return new RegistryStarTable( query );
}
catch ( Exception e ) {
Expand Down
4 changes: 2 additions & 2 deletions vo/src/main/uk/ac/starlink/vo/KeywordServiceQueryFactory.java
Expand Up @@ -158,7 +158,7 @@ public RegistryQuery getQuery() throws MalformedURLException {
}
String adql = sbuf.toString();
String url = new URL( (String) urlSelector_.getUrl() ).toString();
return new RegistryQuery( url, adql );
return new Ri1RegistryQuery( url, adql );
}

public RegistryQuery getIdListQuery( String[] ivoids )
Expand All @@ -183,7 +183,7 @@ public RegistryQuery getIdListQuery( String[] ivoids )
sbuf.append( ")" );
String adql = sbuf.toString();
String url = new URL( (String) urlSelector_.getUrl() ).toString();
return new RegistryQuery( url, adql );
return new Ri1RegistryQuery( url, adql );
}

public JComponent getComponent() {
Expand Down
4 changes: 2 additions & 2 deletions vo/src/main/uk/ac/starlink/vo/RegistryPanel.java
Expand Up @@ -353,9 +353,9 @@ public void performQuery( final RegistryQuery query,
public void run() {
Throwable error = null;
try {
for ( Iterator it = query.getQueryIterator();
for ( Iterator<RegResource> it = query.getQueryIterator();
it.hasNext() && ! isInterrupted() ; ) {
resourceList.add( (RegResource) it.next() );
resourceList.add( it.next() );
progBar.setString( "Found " + resourceList.size() );
}
logger_.info( "Records found: " + resourceList.size() );
Expand Down

0 comments on commit f3abfb2

Please sign in to comment.