Class VendorNarrowingContextInfoCustomizer
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.marketplace.vendor.visibility.narrowing.VendorNarrowingContextInfoCustomizer
-
- All Implemented Interfaces:
ContextInfoCustomizer
,org.springframework.core.Ordered
public class VendorNarrowingContextInfoCustomizer extends Object implements ContextInfoCustomizer
Depending on the current authentication's restrictions/permissions and the current operation's policy requirements, it may be necessary to restrict query results to only include data from certain vendors.This component is responsible for adding a
ContextInfo.QueryInfluencer
toContextInfo.getQueryInfluencers()
that can generate a vendor-narrowing filter appropriate for the current authentication, current policy requirements, and the persisted-domain entity being read.
-
-
Constructor Summary
Constructors Constructor Description VendorNarrowingContextInfoCustomizer(VendorVisibilityManager vendorVisibilityManager, VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
customize(ContextInfo contextInfo, String routeKey, org.springframework.core.MethodParameter endpoint, org.springframework.web.context.request.NativeWebRequest webRequest)
Customize any of the settings on the passed inContextInfo
instance.protected VendorAwareTrackablePolicyUtils
getVendorAwareTrackablePolicyUtils()
protected VendorVisibilityManager
getVendorVisibilityManager()
protected ContextInfo.QueryInfluencer
vendorNarrowingQueryInfluencer()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.data.tracking.core.context.ContextInfoCustomizer
getOrder
-
-
-
-
Constructor Detail
-
VendorNarrowingContextInfoCustomizer
public VendorNarrowingContextInfoCustomizer(VendorVisibilityManager vendorVisibilityManager, VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils)
-
-
Method Detail
-
customize
public void customize(ContextInfo contextInfo, @Nullable String routeKey, @Nullable org.springframework.core.MethodParameter endpoint, @Nullable org.springframework.web.context.request.NativeWebRequest webRequest)
Description copied from interface:ContextInfoCustomizer
Customize any of the settings on the passed inContextInfo
instance.- Specified by:
customize
in interfaceContextInfoCustomizer
- Parameters:
contextInfo
- The instance to customizerouteKey
- Analogous to the key identified byDataRouteByKey
. Useful in restricting the influence of the customization to particular flows. For example, you could use this to limit customization to all catalog service flows by comparing thisrouteKey
to the catalog service'sRouteConstants.CATALOG_ROUTE_KEY
. May be null if the ContextInfo is being customized from a non-standard location, or if data routing is not currently engaged for the flow.endpoint
- The method that initiated the instantiation of this ContextInfo instance. You can use this value to limit customization to a particular endpoint class or method call by inspecting the attributes of this value. May be null if the ContextInfo is being customized from a non-standard location.webRequest
- Web call related information. Can be used to inspect request context information in order to make arbitrary decisions regarding customization. May be null if the ContextInfo is being customized from a non-standard location.
-
vendorNarrowingQueryInfluencer
protected ContextInfo.QueryInfluencer vendorNarrowingQueryInfluencer()
-
getVendorVisibilityManager
protected VendorVisibilityManager getVendorVisibilityManager()
-
getVendorAwareTrackablePolicyUtils
protected VendorAwareTrackablePolicyUtils getVendorAwareTrackablePolicyUtils()
-
-