java.lang.Object
com.broadleafcommerce.common.extension.intercommunication.ExternalClientUtils

@Deprecated(forRemoval=true) public final class ExternalClientUtils extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
use the facilities in com.broadleafcommerce.data.tracking.core.interlink.DefaultInterlinkClient instead.
Utility methods for working with external client calls. Generally leveraged in ExternalClient implementations.
  • Method Details

    • isLoopback

      public static boolean isLoopback(ExternalClientProperties properties, String uri, Supplier<Boolean> fallbackDetection)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine if the supplied uri is actually looping back to the current flexpackage. To make this determination, the broadleaf.flex.package.domain and broadleaf.flex.package.port Spring environment properties are consulted. While unlikely, some implementations may not be using the broadleaf starter-based pattern and these environment properties may be missing. In such a case, the fallbackDetection supplier is used to make the determination instead. Fallback detection generally takes the form of looking for a particular class from the target microservice on the classpath. If such a class is available, that demonstrates the target microservice is resident in the current flexpackage and a loopback determination of true can be made.
      Parameters:
      uri - The connection uri for the microservice communication interlink
      fallbackDetection - Alternate supplier for making a loopback determination.
      Returns:
      Whether the external communication being attempted is actually a link back to the same flexpackage