cfa.vo.iris.utils
Class HarvardNameResolver

java.lang.Object
  extended by cfa.vo.iris.utils.HarvardNameResolver

public class HarvardNameResolver
extends Object

This class represents the actual name resolver service used to convert a target name into a coordinate. We support simbad and ned and they each have a URL interface.


Method Summary
static HarvardNameResolver getInstance()
           
 boolean isIdentifierAmbiguous()
          If resolver returned null, this tells caller whether the most recent call to resolve() returned an ambiguous answer.
 NameResolver.Position resolve(String service, String identifier)
          Convert identifier into coordinates from name resolver.
 NameResolver.Position resolveByNed(String identifier)
           
 NameResolver.Position resolveBySimbad(String identifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static HarvardNameResolver getInstance()

resolve

public NameResolver.Position resolve(String service,
                                     String identifier)
                              throws IOException
Convert identifier into coordinates from name resolver.

Parameters:
identifier - client-requested identifier
Returns:
coordinates corresponding to identifier in this resolver. Returns null if no coordinates could be found (because resolver is unavailable, the identifier was not known to the resulver, or the identifier was ambiguous).
Throws:
ServiceNotAvailableException - if the resolver produced unexpected output or wasn't free to connnect to the service
IOException

resolveBySimbad

public NameResolver.Position resolveBySimbad(String identifier)
                                      throws IOException
Throws:
IOException

resolveByNed

public NameResolver.Position resolveByNed(String identifier)
                                   throws IOException
Throws:
IOException

isIdentifierAmbiguous

public boolean isIdentifierAmbiguous()
If resolver returned null, this tells caller whether the most recent call to resolve() returned an ambiguous answer.

Returns:
true if there was more than one coordinate for the name


Copyright © 2013. All rights reserved.