Interface ContextInfoCustomizer

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
ActiveDateFilteringEnabledContextInfoCustomizer, ActiveFlagFilteringEnabledContextInfoCustomizer, SandboxVisibleCacheEnabledContextInfoCustomizer, VendorNarrowingContextInfoCustomizer

public interface ContextInfoCustomizer extends org.springframework.core.Ordered
Declare instances of this class as beans to influence customization of ContextInfo in a general way upon entry into a service endpoint. Among other customizations, you may add query hints to influence additional criteria for fetch queries in a flow. This is specifically achieved by setting ContextInfo.setQueryHints(ContextInfo.QueryHints) using BroadleafQueryHintKeys.FILTERS as the key. See BroadleafQueryHintKeys.FILTERS for more information on this feature.
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    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 in ContextInfo instance.
    default int
     
  • Method Details

    • customize

      void customize(@NonNull ContextInfo contextInfo, @Nullable String routeKey, @Nullable org.springframework.core.MethodParameter endpoint, @Nullable org.springframework.web.context.request.NativeWebRequest webRequest)
      Customize any of the settings on the passed in ContextInfo instance.
      Parameters:
      contextInfo - The instance to customize
      routeKey - Analogous to the key identified by DataRouteByKey. 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 this routeKey to the catalog service's RouteConstants.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.
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered