Class WebClientExternalSystemContentProvider

java.lang.Object
com.flowable.engage.external.system.service.WebClientExternalSystemContentProvider
All Implemented Interfaces:
ExternalSystemContentProvider

public class WebClientExternalSystemContentProvider
extends java.lang.Object
implements ExternalSystemContentProvider
ExternalSystemContentProvider that uses WebClient to fetch the external content.
Author:
Filip Hrisafov
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.String externalSystemId  
    protected org.springframework.web.reactive.function.client.WebClient webClient  
  • Constructor Summary

    Constructors 
    Constructor Description
    WebClientExternalSystemContentProvider​(java.lang.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.
  • Method Summary

    Modifier and Type Method Description
    reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<? extends org.springframework.core.io.Resource>> getContentData​(java.lang.String businessAccountId, java.lang.String externalMediaId)
    Fetch the external media from the external system.
    java.lang.String getExternalSystemId()
    Returns the id of the external system implemented by this adapter.

    Methods inherited from class java.lang.Object

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

    • externalSystemId

      protected final java.lang.String externalSystemId
    • webClient

      protected final org.springframework.web.reactive.function.client.WebClient webClient
  • Constructor Details

    • WebClientExternalSystemContentProvider

      public WebClientExternalSystemContentProvider​(java.lang.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. The requests will be issued by suffixing the businessAccountId and / or the externalMediaId
      Parameters:
      externalSystemId - the id of the external system
      webClient - the preconfigured WebClient
  • Method Details

    • getExternalSystemId

      public java.lang.String getExternalSystemId()
      Description copied from interface: ExternalSystemContentProvider
      Returns the id of the external system implemented by this adapter.
      Specified by:
      getExternalSystemId in interface ExternalSystemContentProvider
      Returns:
      the external system id implemented by this adapter
    • getContentData

      public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<? extends org.springframework.core.io.Resource>> getContentData​(java.lang.String businessAccountId, java.lang.String externalMediaId)
      Description copied from interface: ExternalSystemContentProvider
      Fetch the external media from the external system.
      Specified by:
      getContentData in interface ExternalSystemContentProvider
      Parameters:
      businessAccountId - the id of the business account
      externalMediaId - the id of the content
      Returns:
      a mono with the response entity containing the resource for the externalMediaId