|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.starlink.registry.AbstractRegistryClient<R>
public abstract class AbstractRegistryClient<R>
Can submit ADQL queries to a registry and return the result as a list of resources. This class uses custom SAX parsing of the SOAP response to ensure that even a large response (not uncommon) can be processed without large client-side resource usage. For this reason, no use is made of the maximum record limit options provided by RI 1.0; there's no client-side need for it.
Constructor Summary | |
---|---|
AbstractRegistryClient(SoapClient soapClient)
Constructs a AbstractRegistryClient given a SOAP client. |
Method Summary | |
---|---|
protected abstract ContentHandler |
createResourceHandler(ResourceSink<R> sink)
Returns a SAX ContentHandler which can parse a VOResources element and feed items of some type R to a ResourceSink object. |
URL |
getEndpoint()
Returns the SOAP endpoint this client talks to. |
Iterator<R> |
getResourceIterator(SoapRequest request)
Returns an iterator over resources corresponding to a given SOAP request. |
List<R> |
getResourceList(SoapRequest request)
Returns a list of resources corresponding to a given SOAP request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractRegistryClient(SoapClient soapClient)
soapClient
- SOAP client which talks to an RI-compliant
registry serviceMethod Detail |
---|
protected abstract ContentHandler createResourceHandler(ResourceSink<R> sink)
sink
- receiver of resource objects
public URL getEndpoint()
public List<R> getResourceList(SoapRequest request) throws IOException
createResourceHandler(uk.ac.starlink.registry.ResourceSink)
.
request
- SOAP request
IOException
public Iterator<R> getResourceIterator(SoapRequest request) throws IOException
createResourceHandler(uk.ac.starlink.registry.ResourceSink)
.
The iterator's next
or hasNext
method
may throw a RegistryQueryException
.
The writing thread will only read resources from the SAX response as they are read out by the thread iterating over this iterator, so memory used by this class remains very small regardless of the number of records processed.
request
- SOAP request
next
method may
throw a RegistryQueryException
IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |