net.ivoa.registry.search
Class RegistrySearchClient

java.lang.Object
  extended by net.ivoa.registry.search.RegistrySearchClient

public class RegistrySearchClient
extends java.lang.Object

a registry search client class


Field Summary
static java.net.URL defaultEndpoint
          the default registry endpoint to connect to.
static short LOOSE_COMPLIANCE
          Adapt silently to any service compliance errors when possible.
protected  int resIDBuffer
           
protected  int resRecordBuffer
           
protected  SOAPSearchClient service
           
static short STRICT_COMPLIANCE
          Throw an exception whenever the registry does not comply with the Registry Interface specification.
protected  short strictness
           
static short WARN_COMPLIANCE
          Warn about any service compliance errors with a message to standard error, but otherwise adapt when possible.
 
Constructor Summary
RegistrySearchClient()
          create a client configured to connect to the configured default registry
RegistrySearchClient(java.net.URL endpointURL)
          create a client connected to a registry with the given endpoint URL
 
Method Summary
 short getCompliance()
          Set the tolerance toward non-compliance with the Registry Interface standard.
 VOResource getIdentity()
          return the description of the registry.
 int getRecordBufferSize()
          return the size of the record buffer.
 VOResource getResource(java.lang.String ivoid)
          return the Resource description for a given identifier.
 Identifiers identifiersByADQL(java.lang.String adqlWhere)
          search for the resource identifiers whose descriptions match an ADQL query.
 Identifiers identifiersByKeywords(java.lang.String keywords, boolean orThem)
          search for the resource identifiers whose descriptions contain specific keywords.
 Records searchByADQL(java.lang.String adqlWhere)
          search for the resource descriptions based on a detailed ADQL query
 Records searchByKeywords(java.lang.String keywords, boolean orThem)
          search for resource descriptions containing specific keywords.
 org.w3c.dom.Element searchByXQuery(java.lang.String xquery)
          search for resource description information using XQuery.
 void setCaller(ServiceCaller c)
          set the SOAP ServiceCaller implementation to use.
 void setCompliance(short level)
          Set the tolerance toward non-compliance with the Registry Interface standard.
 void setRecordBufferSize(int size)
          return the size of the record buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resRecordBuffer

protected int resRecordBuffer

resIDBuffer

protected int resIDBuffer

service

protected SOAPSearchClient service

strictness

protected short strictness

defaultEndpoint

public static java.net.URL defaultEndpoint
the default registry endpoint to connect to. This can be overridden via the system property "VORegsitry.search.defaultRegistry".


LOOSE_COMPLIANCE

public static final short LOOSE_COMPLIANCE
Adapt silently to any service compliance errors when possible. See setCompliance().

See Also:
Constant Field Values

WARN_COMPLIANCE

public static final short WARN_COMPLIANCE
Warn about any service compliance errors with a message to standard error, but otherwise adapt when possible. See setCompliance().

See Also:
Constant Field Values

STRICT_COMPLIANCE

public static final short STRICT_COMPLIANCE
Throw an exception whenever the registry does not comply with the Registry Interface specification. See setCompliance().

See Also:
Constant Field Values
Constructor Detail

RegistrySearchClient

public RegistrySearchClient()
create a client configured to connect to the configured default registry


RegistrySearchClient

public RegistrySearchClient(java.net.URL endpointURL)
create a client connected to a registry with the given endpoint URL

Method Detail

setCompliance

public void setCompliance(short level)
Set the tolerance toward non-compliance with the Registry Interface standard. See fields LOOSE_COMPLIANCE, WARN_COMPLIANCE, and STRICT_COMPLIANCE possible input values.


getCompliance

public short getCompliance()
Set the tolerance toward non-compliance with the Registry Interface standard. See fields LOOSE_COMPLIANCE, WARN_COMPLIANCE, and STRICT_COMPLIANCE possible return values.


getRecordBufferSize

public int getRecordBufferSize()
return the size of the record buffer. The resource record search methods will buffer a maximum of this many records in its memory at a time.


setRecordBufferSize

public void setRecordBufferSize(int size)
return the size of the record buffer. The resource record search methods will buffer a maximum of this many records in its memory at a time.


getIdentity

public VOResource getIdentity()
                       throws RegistryAccessException
return the description of the registry.

Note that all of the checked exceptions thrown by this method inherit from a common base class, RegistryAccessException.

Throws:
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryCommException - if an unexpected protocol error is encountered.
RegistryFormatException - if the response does not contain a VOResource record.
RegistryAccessException

getResource

public VOResource getResource(java.lang.String ivoid)
                       throws IDNotFoundException,
                              RegistryAccessException
return the Resource description for a given identifier.

Note that all of the checked exceptions thrown by this method inherit from a common base class, RegistryAccessException.

Parameters:
ivoid - the IVOA Identifier to resolve
Throws:
IDNotFoundException - if the service cannot match the given ID to a description
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryCommException - if an unexpected protocol error is encountered.
RegistryAccessException

searchByKeywords

public Records searchByKeywords(java.lang.String keywords,
                                boolean orThem)
                         throws RegistryServiceException,
                                RegistryFormatException,
                                RegistryCommException
search for resource descriptions containing specific keywords.

Note that all of the checked exceptions thrown by this method inherit from a common base class, RegistryAccessException.

Parameters:
keywords - the list of keywords to search for
orThem - if true, return records that contains at least one keyword; otherwise, return those that have all keywords.
Throws:
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryFormatException - if the XML response is non-compliant in some way.
RegistryCommException - if an unexpected protocol error is encountered.

identifiersByKeywords

public Identifiers identifiersByKeywords(java.lang.String keywords,
                                         boolean orThem)
                                  throws RegistryServiceException,
                                         RegistryFormatException,
                                         RegistryCommException
search for the resource identifiers whose descriptions contain specific keywords.

Note that all of the checked exceptions thrown by this method inherit from a common base class, RegistryAccessException.

Parameters:
keywords - the list of keywords to search for
orThem - if true, return records that contains at least one keyword; otherwise, return those that have all keywords.
Throws:
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryFormatException - if the XML response is non-compliant in some way.
RegistryCommException - if an unexpected protocol error is encountered.

searchByADQL

public Records searchByADQL(java.lang.String adqlWhere)
                     throws RegistryServiceException,
                            RegistryFormatException,
                            RegistryCommException,
                            ADQLSyntaxException
search for the resource descriptions based on a detailed ADQL query

Parameters:
adqlWhere - the ADQL Where clause that constrains the search
Throws:
ADQLSyntaxException - if a syntax error is detected in the input ADQL string.
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryFormatException - if the XML response is non-compliant in some way.
RegistryCommException - if an unexpected protocol error is encountered.

identifiersByADQL

public Identifiers identifiersByADQL(java.lang.String adqlWhere)
                              throws RegistryServiceException,
                                     RegistryFormatException,
                                     RegistryCommException,
                                     ADQLSyntaxException
search for the resource identifiers whose descriptions match an ADQL query.

Note that all of the checked exceptions thrown by this method inherit from a common base class, RegistryAccessException.

Parameters:
adqlWhere - the ADQL Where clause that constrains the search
Throws:
ADQLSyntaxException - if a syntax error is detected in the input ADQL string.
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryFormatException - if the XML response is non-compliant in some way.
RegistryCommException - if an unexpected protocol error is encountered.

searchByXQuery

public org.w3c.dom.Element searchByXQuery(java.lang.String xquery)
                                   throws RegistryServiceException,
                                          UnsupportedOperationException,
                                          RegistryCommException
search for resource description information using XQuery.

Note that all of the checked exceptions thrown by this method inherit from a common base class, RegistryAccessException.

Parameters:
String - the XQuery stored as a string.
Throws:
RegistryServiceException - if the service encounters an error (i.e. on the server side).
RegistryFormatException - if the XML response is non-compliant in some way.
RegistryCommException - if an unexpected protocol error is encountered.
UnsupportedOperationException

setCaller

public void setCaller(ServiceCaller c)
set the SOAP ServiceCaller implementation to use. It will be initialized with the service endpoint. If the input is null, the default caller will be restored.

Parameters:
c - the caller object
See Also:
ServiceCaller