public class WebClientExternalSystemContentProvider extends Object implements ExternalSystemContentProvider
ExternalSystemContentProvider
that uses WebClient
to fetch the external content.Modifier and Type | Field and Description |
---|---|
protected String |
externalSystemId |
protected org.springframework.web.reactive.function.client.WebClient |
webClient |
Constructor and Description |
---|
WebClientExternalSystemContentProvider(String externalSystemId,
org.springframework.web.reactive.function.client.WebClient webClient)
Create a new
ExternalSystemContentProvider that uses a preconfigured WebClient
with the path to the external content resource. |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<? extends org.springframework.core.io.Resource>> |
getContentData(String businessAccountId,
String externalMediaId)
Fetch the external media from the external system.
|
String |
getExternalSystemId()
Returns the id of the external system implemented by this adapter.
|
protected final String externalSystemId
protected final org.springframework.web.reactive.function.client.WebClient webClient
public WebClientExternalSystemContentProvider(String externalSystemId, org.springframework.web.reactive.function.client.WebClient webClient)
ExternalSystemContentProvider
that uses a preconfigured WebClient
with the path to the external content resource.
The requests will be issued by suffixing the businessAccountId
and / or the externalMediaId
externalSystemId
- the id of the external systemwebClient
- the preconfigured WebClientpublic String getExternalSystemId()
ExternalSystemContentProvider
getExternalSystemId
in interface ExternalSystemContentProvider
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<? extends org.springframework.core.io.Resource>> getContentData(String businessAccountId, String externalMediaId)
ExternalSystemContentProvider
getContentData
in interface ExternalSystemContentProvider
businessAccountId
- the id of the business accountexternalMediaId
- the id of the contentCopyright © 2019. All rights reserved.