Class TppConnectorImpl

java.lang.Object
it.gov.pagopa.onboarding.citizen.connector.tpp.TppConnectorImpl
All Implemented Interfaces:
TppConnector

@Service public class TppConnectorImpl extends Object implements TppConnector

Reactive TppConnector implementation using Spring WebClient to fetch Third Party Provider (TPP) data from a remote service.

  • Constructor Summary

    Constructors
    Constructor
    Description
    TppConnectorImpl(org.springframework.web.reactive.function.client.WebClient.Builder webClientBuilder, String baseUrl)
    Constructs the connector initializing the WebClient with the provided base URL.
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<List<TppDTO>>
    Retrieves TPPs with recipientId on the whitelist and enabled TPPs from a list of TPP identifiers.
    reactor.core.publisher.Mono<TppDTO>
    get(String tppId)
    Retrieves the TPP associated with the provided identifier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TppConnectorImpl

      public TppConnectorImpl(org.springframework.web.reactive.function.client.WebClient.Builder webClientBuilder, @Value("${rest-client.tpp.baseUrl}") String baseUrl)

      Constructs the connector initializing the WebClient with the provided base URL.

      Parameters:
      webClientBuilder - Spring-injected builder to create WebClient instances
      baseUrl - remote TPP service base URL (property: rest-client.tpp.baseUrl)
  • Method Details

    • get

      public reactor.core.publisher.Mono<TppDTO> get(String tppId)

      Retrieves the TPP associated with the provided identifier.

      Performs a reactive HTTP GET to /emd/tpp/{tppId}.

      Specified by:
      get in interface TppConnector
      Parameters:
      tppId - technical or functional identifier of the TPP
      Returns:
      Mono<TppDTO> emitting the found DTO or Mono.empty() if missing
    • filterEnabledList

      public reactor.core.publisher.Mono<List<TppDTO>> filterEnabledList(TppIdList tppIdList)

      Retrieves TPPs with recipientId on the whitelist and enabled TPPs from a list of TPP identifiers.

      Delegates to the emd-tpp service filtering endpoint.

      Performs a reactive HTTP POST to /emd/tpp/list with the provided TPP IDs and recipientId.

      Specified by:
      filterEnabledList in interface TppConnector
      Parameters:
      tppIdList - the list of TPP IDs to filter and the recipientId for whitelist filtering
      Returns:
      Mono<List<TppDTO>> list of enabled TPPs matching the provided IDs