public class ApiVersionInterceptor
extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
HandlerInterceptor
that inspects the service broker API version passed in all request headers
and compares it to the API version supported by the broker.Constructor and Description |
---|
ApiVersionInterceptor()
Construct an interceptor that disables API version validation.
|
ApiVersionInterceptor(BrokerApiVersion version)
Construct an interceptor that validates the API version passed in request headers to the
configured version.
|
Modifier and Type | Method and Description |
---|---|
boolean |
preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
Compares the service broker API version header to the supported version.
|
public ApiVersionInterceptor()
public ApiVersionInterceptor(BrokerApiVersion version)
version
- the API version supported by the broker.public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler) throws ServiceBrokerApiVersionException
preHandle
in interface org.springframework.web.servlet.HandlerInterceptor
preHandle
in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
request
- response
- handler
- ServiceBrokerApiVersionException
- if the API version header value does not match the version
supported by the broker