Source:
<code>public SendEvent( TransformerManager transformerManager, GetRecordsType request, QueryRequest query, ClientBuilderFactory clientBuilderFactory, Security security) throws CswException { URL deliveryMethodUrl; if (request.getResponseHandler() != null && !request.getResponseHandler().isEmpty()) { try { deliveryMethodUrl = new URL(request.getResponseHandler().get(0)); } catch (MalformedURLException e) { throw new CswException("Invalid ResponseHandler URL", e); } if (!"https".equals(deliveryMethodUrl.getProtocol())) { throw new CswException( "Invalid protocol for response handler expected https but was " + deliveryMethodUrl.getProtocol()); } } else { String msg = "Subscriptions require a ResponseHandler URL to be specified"; LOGGER.debug(msg); throw new CswException(msg); } this.security = security; this.query = query; this.callbackUrl = deliveryMethodUrl; this.request = request; this.outputSchema = request.getOutputSchema(); this.mimeType = request.getOutputFormat(); QueryType queryType = (QueryType) request.getAbstractQuery().getValue(); this.elementName = queryType.getElementName(); this.elementSetType = (queryType.getElementSetName() != null) ? queryType.getElementSetName().getValue() : null; this.resultType = request.getResultType() == null ? ResultType.HITS : request.getResultType(); List providers = ImmutableList.of(new CswRecordCollectionMessageBodyWriter(transformerManager)); ClientBuilder<CswSubscribe> clientBuilder = clientBuilderFactory.getClientBuilder(); try { cxfClientFactory = clientBuilder .endpoint(callbackUrl.toURI()) .interfaceClass(CswSubscribe.class) .entityProviders(providers) .useSamlEcp(true) <START> .useSubjectRetrievalInterceptor(true) <END> .build(); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } try { InetAddress address = InetAddress.getByName(callbackUrl.getHost()); ip = address.getHostAddress(); } catch (UnknownHostException e) { LOGGER.debug("Unable to resolve callback address", e); } ping(); }</code><technical_language>This api method</technical_language>

Target:
public SendEvent( TransformerManager transformerManager, GetRecordsType request, QueryRequest query, ClientBuilderFactory clientBuilderFactory, Security security) throws CswException { URL deliveryMethodUrl; if (request.getResponseHandler() != null && !request.getResponseHandler().isEmpty()) { try { deliveryMethodUrl = new URL(request.getResponseHandler().get(0)); } catch (MalformedURLException e) { throw new CswException("Invalid ResponseHandler URL", e); } if (!"https".equals(deliveryMethodUrl.getProtocol())) { throw new CswException( "Invalid protocol for response handler expected https but was " + deliveryMethodUrl.getProtocol()); } } else { String msg = "Subscriptions require a ResponseHandler URL to be specified"; LOGGER.debug(msg); throw new CswException(msg); } this.security = security; this.query = query; this.callbackUrl = deliveryMethodUrl; this.request = request; this.outputSchema = request.getOutputSchema(); this.mimeType = request.getOutputFormat(); QueryType queryType = (QueryType) request.getAbstractQuery().getValue(); this.elementName = queryType.getElementName(); this.elementSetType = (queryType.getElementSetName() != null) ? queryType.getElementSetName().getValue() : null; this.resultType = request.getResultType() == null ? ResultType.HITS : request.getResultType(); List providers = ImmutableList.of(new CswRecordCollectionMessageBodyWriter(transformerManager)); ClientBuilder<CswSubscribe> clientBuilder = clientBuilderFactory.getClientBuilder(); cxfClientFactory = clientBuilder .endpoint(callbackUrl.toString()) .interfaceClass(CswSubscribe.class) .entityProviders(providers) .useSamlEcp(true) .useSubjectRetrievalInterceptor() .build(); try { InetAddress address = InetAddress.getByName(callbackUrl.getHost()); ip = address.getHostAddress(); } catch (UnknownHostException e) { LOGGER.debug("Unable to resolve callback address", e); } ping(); }