Skip to content

Commit

Permalink
feat(impl):[#225] Introduce bean provider method for DiscoveryFinderC…
Browse files Browse the repository at this point in the history
…lient in order to be able to apply caching annotations later
  • Loading branch information
dsmf committed Dec 8, 2023
1 parent 4d754fd commit 68c3429
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.eclipse.tractusx.irs.registryclient.decentral.EdcRetrieverException;
import org.eclipse.tractusx.irs.registryclient.decentral.EndpointDataForConnectorsService;
import org.eclipse.tractusx.irs.registryclient.discovery.ConnectorEndpointsService;
import org.eclipse.tractusx.irs.registryclient.discovery.DiscoveryFinderClient;
import org.eclipse.tractusx.irs.registryclient.discovery.DiscoveryFinderClientImpl;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -86,7 +87,14 @@ public DecentralDigitalTwinRegistryService decentralDigitalTwinRegistryService(
public ConnectorEndpointsService connectorEndpointsService(
@Qualifier(RestTemplateConfig.DTR_REST_TEMPLATE) final RestTemplate dtrRestTemplate,
@Value("${digitalTwinRegistry.discoveryFinderUrl:}") final String finderUrl) {
return new ConnectorEndpointsService(new DiscoveryFinderClientImpl(finderUrl, dtrRestTemplate));
return new ConnectorEndpointsService(discoveryFinderClient(dtrRestTemplate, finderUrl));
}

@Bean
public DiscoveryFinderClient discoveryFinderClient(
@Qualifier(RestTemplateConfig.DTR_REST_TEMPLATE) final RestTemplate dtrRestTemplate,
@Value("${digitalTwinRegistry.discoveryFinderUrl:}") final String finderUrl) {
return new DiscoveryFinderClientImpl(finderUrl, dtrRestTemplate);
}

}

0 comments on commit 68c3429

Please sign in to comment.