use of org.geosdi.geoplatform.connector.GPCSWConnectorBuilder in project geo-platform by geosdi.
the class CSWServiceDelegate method createGetRecordsRequest.
private CatalogGetRecordsRequest<GetRecordsResponseType> createGetRecordsRequest(String serverUrl) throws Exception {
GPCatalogConnectorStore serverConnector = null;
try {
URL url = new URL(serverUrl);
GPCSWConnectorBuilder builder = GPCSWConnectorBuilder.newConnector().withServerUrl(url).withProxyConfiguration(cswProxyConfiguration);
if (serverUrl.contains("snipc.protezionecivile.it")) {
GPSecurityConnector securityConnector = new BasicPreemptiveSecurityConnector(snipcProvider.getSnipcUsername(), snipcProvider.getSnipcPassword());
builder.withClientSecurity(securityConnector);
}
serverConnector = builder.build();
} catch (MalformedURLException ex) {
logger.error("### MalformedURLException: {}", ex.getMessage());
throw new IllegalParameterFault("Malformed URL");
}
CatalogGetRecordsRequest<GetRecordsResponseType> request = serverConnector.createGetRecordsRequest();
return request;
}
use of org.geosdi.geoplatform.connector.GPCSWConnectorBuilder in project geo-platform by geosdi.
the class CSWServiceDelegate method createServerConnector.
private GPCatalogConnectorStore createServerConnector(String serverUrl) throws Exception {
GPCatalogConnectorStore serverConnector;
try {
URL url = new URL(serverUrl);
GPCSWConnectorBuilder builder = GPCSWConnectorBuilder.newConnector().withServerUrl(url).withProxyConfiguration(cswProxyConfiguration);
if (serverUrl.contains("snipc.protezionecivile.it")) {
GPSecurityConnector securityConnector = new BasicPreemptiveSecurityConnector(snipcProvider.getSnipcUsername(), snipcProvider.getSnipcPassword());
builder.withClientSecurity(securityConnector);
}
serverConnector = builder.build();
} catch (MalformedURLException ex) {
logger.error("### MalformedURLException: {}", ex.getMessage());
throw new IllegalParameterFault("Malformed URL");
}
return serverConnector;
}
Aggregations