Search in sources :

Example 1 with GPCSWConnectorBuilder

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;
}
Also used : GPCatalogConnectorStore(org.geosdi.geoplatform.connector.GPCatalogConnectorStore) MalformedURLException(java.net.MalformedURLException) IllegalParameterFault(org.geosdi.geoplatform.exception.IllegalParameterFault) GPSecurityConnector(org.geosdi.geoplatform.connector.server.security.GPSecurityConnector) GPCSWConnectorBuilder(org.geosdi.geoplatform.connector.GPCSWConnectorBuilder) BasicPreemptiveSecurityConnector(org.geosdi.geoplatform.connector.server.security.BasicPreemptiveSecurityConnector) URL(java.net.URL)

Example 2 with GPCSWConnectorBuilder

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;
}
Also used : GPCatalogConnectorStore(org.geosdi.geoplatform.connector.GPCatalogConnectorStore) MalformedURLException(java.net.MalformedURLException) IllegalParameterFault(org.geosdi.geoplatform.exception.IllegalParameterFault) GPSecurityConnector(org.geosdi.geoplatform.connector.server.security.GPSecurityConnector) GPCSWConnectorBuilder(org.geosdi.geoplatform.connector.GPCSWConnectorBuilder) BasicPreemptiveSecurityConnector(org.geosdi.geoplatform.connector.server.security.BasicPreemptiveSecurityConnector) URL(java.net.URL)

Aggregations

MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 GPCSWConnectorBuilder (org.geosdi.geoplatform.connector.GPCSWConnectorBuilder)2 GPCatalogConnectorStore (org.geosdi.geoplatform.connector.GPCatalogConnectorStore)2 BasicPreemptiveSecurityConnector (org.geosdi.geoplatform.connector.server.security.BasicPreemptiveSecurityConnector)2 GPSecurityConnector (org.geosdi.geoplatform.connector.server.security.GPSecurityConnector)2 IllegalParameterFault (org.geosdi.geoplatform.exception.IllegalParameterFault)2