Class ExternalClientUtils
java.lang.Object
com.broadleafcommerce.common.extension.intercommunication.ExternalClientUtils
Deprecated, for removal: This API element is subject to removal in a future version.
Utility methods for working with external client calls. Generally leveraged in
ExternalClient implementations.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisLoopback(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.
-
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, thebroadleaf.flex.package.domainandbroadleaf.flex.package.portSpring 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, thefallbackDetectionsupplier 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 interlinkfallbackDetection- Alternate supplier for making a loopback determination.- Returns:
- Whether the external communication being attempted is actually a link back to the same flexpackage
-
com.broadleafcommerce.data.tracking.core.interlink.DefaultInterlinkClientinstead.