public class InterceptorResolution
extends java.lang.Object
TunnelRequestInterceptor.validateRequest(String, HttpRequestHeader).
The possible resolutions are:
InterceptorResolution.Resolution.PROCEED (created by method proceed()) -
instructs the HTTP tunnel to proceed with forwarding of this request to the target device.
InterceptorResolution.Resolution.DENY (created by method deny()) -
instructs the HTTP tunnel to NOT forward the request to the target gateway and to return error
403 Forbidden to the caller.
InterceptorResolution.Resolution.RETURN_RESPONSE (created by method response(int, String, Map)) -
instructs the HTTP tunnel to NOT forward the request to the target gateway and to return the specified
HTTP response to the caller.
| Modifier and Type | Class and Description |
|---|---|
static class |
InterceptorResolution.Resolution |
| Modifier and Type | Method and Description |
|---|---|
static InterceptorResolution |
deny()
Creates InterceptorResolution result which instructs the HTTP tunnel to NOT forward the request to the target device
and to return
403 Forbidden to the caller. |
int |
getHttpResponse()
Valid only if the resolution is
InterceptorResolution.Resolution.RETURN_RESPONSE |
InterceptorResolution.Resolution |
getResolution() |
java.util.Map<java.lang.String,java.lang.String> |
getResponseHeaders()
Valid only if the resolution is
InterceptorResolution.Resolution.RETURN_RESPONSE |
java.lang.String |
getResponsePhrase()
Valid only if the resolution is
InterceptorResolution.Resolution.RETURN_RESPONSE |
static InterceptorResolution |
proceed()
Creates InterceptorResolution result which instructs the HTTP tunnel to proceed with forwarding of the request.
|
static InterceptorResolution |
response(int httpResponse,
java.lang.String responsePhrase,
java.util.Map<java.lang.String,java.lang.String> responseHeaders)
Creates InterceptorResolution result which instructs the HTTP tunnel to NOT forward the request to the target device
and to return HTTP response specified by the interceptor.
|
public static InterceptorResolution proceed()
InterceptorResolution.Resolution.PROCEED.public static InterceptorResolution deny()
403 Forbidden to the caller.InterceptorResolution.Resolution.DENY.public static InterceptorResolution response(int httpResponse, java.lang.String responsePhrase, java.util.Map<java.lang.String,java.lang.String> responseHeaders)
httpResponse - the HTTP response code to be returned to the caller.responsePhrase - the HTTP response phrase to be returned to the caller.responseHeaders - the HTTP response headers to be returned to the caller.InterceptorResolution.Resolution.RETURN_RESPONSE.public InterceptorResolution.Resolution getResolution()
public int getHttpResponse()
InterceptorResolution.Resolution.RETURN_RESPONSEpublic java.lang.String getResponsePhrase()
InterceptorResolution.Resolution.RETURN_RESPONSEpublic java.util.Map<java.lang.String,java.lang.String> getResponseHeaders()
InterceptorResolution.Resolution.RETURN_RESPONSECopyright © 2019 Bosch Software Innovations GmbH. All Rights Reserved.