0

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?

1 Answer 1

1

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!

Not the answer you're looking for? Browse other questions tagged or ask your own question.