public abstract class AbstractRegistryClient<R> extends Object
Constructor and Description |
---|
AbstractRegistryClient(SoapClient soapClient)
Constructs a AbstractRegistryClient given a SOAP client.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public AbstractRegistryClient(SoapClient soapClient)
soapClient
- SOAP client which talks to an RI-compliant
registry serviceprotected abstract ContentHandler createResourceHandler(ResourceSink<R> sink)
sink
- receiver of resource objectspublic URL getEndpoint()
public List<R> getResourceList(SoapRequest request) throws IOException
createResourceHandler(uk.ac.starlink.registry.ResourceSink<R>)
.request
- SOAP requestIOException
public Iterator<R> getResourceIterator(SoapRequest request) throws IOException
createResourceHandler(uk.ac.starlink.registry.ResourceSink<R>)
.
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 requestnext
method may
throw a RegistryQueryException
IOException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.