I need a simple but fast CSW client. CatalogServicesClient
is created terribly slow. I was about to write my own pool but suddenly found org.geotoolkit.csw.CSWClientFactory
not mentioned in anywhere. It has open()
with sematics that makes no sense to me.
Any directions please?
Answer
Diving into the lib source code gives the following solution.
Prepare factory and params (cache into fields assumably):
CSWClientFactory cswClientFactory = new CSWClientFactory();
ParameterValueGroup clientFactoryParams = CSWClientFactory.PARAMETERS.createValue();
clientFactoryParams.parameter(AbstractClientFactory.URL.getName().getCode()).setValue(new URL(serviceURL));
Obtain the client when you need it:
CatalogServicesClient catalogServicesClient = (CatalogServicesClient) cswClientFactory.open(clientFactoryParams);
Subsequent calls are blazingly fast!
No comments:
Post a Comment