public class RegistryClient
extends java.lang.Object
Deployers can set a java system property to force this class to replace the hostname in the resulting URL with an arbitrary hostname. This is useful for testing a specific remote server:
ca.nrc.cadc.reg.client.RegistryClient.host=www.example.com
The ca.nrc.cadc.reg.client.RegistryClient.host property replaces the entire fully-qualified host name
with the specified value.
| Modifier and Type | Class and Description |
|---|---|
static class |
RegistryClient.Query |
| Constructor and Description |
|---|
RegistryClient() |
| Modifier and Type | Method and Description |
|---|---|
java.net.URL |
getAccessURL(RegistryClient.Query queryName,
java.net.URI uri)
Get the accessURL for the resourceID or standardID from the specified query.
|
java.net.URL |
getAccessURL(java.net.URI resourceID)
Backwards compatibility/convenience: get the capabilities URL for the specified service.
|
Capabilities |
getCapabilities(java.net.URI resourceID)
Get the capabilities object for the resource identified
by resourceID.
|
static java.lang.String |
getDomain(java.lang.String hostname) |
java.net.URL |
getServiceURL(java.net.URI resourceIdentifier,
java.net.URI standardID,
ca.nrc.cadc.auth.AuthMethod authMethod)
Find the service URL for the service registered under the specified base resource
identifier and using the specified authentication method.
|
java.net.URL |
getServiceURL(java.net.URI resourceID,
java.net.URI standardID,
ca.nrc.cadc.auth.AuthMethod authMethod,
java.net.URI interfaceType)
Find the service URL for the service registered under the specified base resource
identifier and using the specified authentication method.
|
boolean |
isRegistryLookupOverride()
Find out if registry lookup URL was modified by a system property.
|
java.net.URL |
mangleHostname(java.net.URL url) |
public boolean isRegistryLookupOverride()
public java.net.URL getAccessURL(java.net.URI resourceID)
throws java.io.IOException,
ca.nrc.cadc.net.ResourceNotFoundException
resourceID - of a service that implements VOSI-capabilitiesjava.io.IOException - local cache file(s) cannot be read or writtenca.nrc.cadc.net.ResourceNotFoundException - if the resourceID cannot be found in the registrypublic java.net.URL getAccessURL(RegistryClient.Query queryName, java.net.URI uri) throws java.io.IOException, ca.nrc.cadc.net.ResourceNotFoundException
queryName - name of the canned query: QUERY_CAPABILITIES or QUERY_APPLICATIONSuri - a resourceID (for QUERY_CAPABILITIES) or a standardID (for QUERY_APPLICATIONS)java.io.IOException - If the cache file cannot be readca.nrc.cadc.net.ResourceNotFoundException - if the resourceID cannot be found in the registrypublic Capabilities getCapabilities(java.net.URI resourceID) throws java.io.IOException, ca.nrc.cadc.net.ResourceNotFoundException
resourceID - Identifies the resource.java.io.IOException - If the capabilities could not be determined.ca.nrc.cadc.net.ResourceNotFoundException - if the resourceID cannot be found in the registrypublic java.net.URL getServiceURL(java.net.URI resourceIdentifier,
java.net.URI standardID,
ca.nrc.cadc.auth.AuthMethod authMethod)
resourceIdentifier - resource identifier, e.g. ivo://cadc.nrc.ca/tapstandardID - IVOA standard identifier, e.g. ivo://ivo.net/std/TAPauthMethod - authentication method to be usedpublic java.net.URL getServiceURL(java.net.URI resourceID,
java.net.URI standardID,
ca.nrc.cadc.auth.AuthMethod authMethod,
java.net.URI interfaceType)
resourceID - ID of the resource to lookup.standardID - The standard ID of the resource to look up. Indicates the specific purpose of
the resource to get a URL for.authMethod - What Authentication method to use (certificate, cookie, etc.)interfaceType - Interface type indicating how to access the resource (e.g. HTTP). See IVOA
resource identifierspublic java.net.URL mangleHostname(java.net.URL url)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.lang.String getDomain(java.lang.String hostname)