java.lang.Object
org.springframework.cloud.servicebroker.autoconfigure.web.servlet.ApiVersionInterceptor
All Implemented Interfaces:
HandlerInterceptor

public class ApiVersionInterceptor extends Object implements HandlerInterceptor
HandlerInterceptor that inspects the service broker API version passed in all request headers and compares it to the API version supported by the broker.
Author:
Scott Frederick
  • Constructor Details

    • ApiVersionInterceptor

      public ApiVersionInterceptor()
      Construct an interceptor that disables API version validation.
    • ApiVersionInterceptor

      public ApiVersionInterceptor(BrokerApiVersion version)
      Construct an interceptor that validates the API version passed in request headers to the configured version.
      Parameters:
      version - the API version supported by the broker.
  • Method Details

    • preHandle

      public boolean preHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler)
      Compares the service broker API version header to the supported version.
      Specified by:
      preHandle in interface HandlerInterceptor
      Parameters:
      request -
      response -
      handler -
      Throws:
      ServiceBrokerApiVersionException - if the API version header value does not match the version supported by the broker