public class TopologyRequestValidator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HASH_HEADER |
static java.lang.String |
SIG_HEADER |
Constructor and Description |
---|
TopologyRequestValidator(BaseConfig config)
Create a TopologyRequestValidator.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decodeMessage(javax.servlet.http.HttpServletRequest request)
Decode a message sent from the client.
|
java.lang.String |
decodeMessage(java.lang.String uri,
org.apache.http.HttpResponse response)
Decode a response from the server.
|
java.lang.String |
encodeMessage(java.lang.String body)
Encodes a request returning the encoded body
|
boolean |
isTrusted(org.apache.http.HttpResponse response)
Is the response from the server to be trusted by the client.
|
boolean |
isTrusted(javax.servlet.http.HttpServletRequest request)
Is the request from the client trusted, based on the signature headers.
|
void |
trustMessage(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
java.lang.String body)
Trust a response message sent from the server to the client.
|
void |
trustMessage(org.apache.http.client.methods.HttpUriRequest method,
java.lang.String body)
Trust a message on the client before sending, only if trust is enabled.
|
public static final java.lang.String SIG_HEADER
public static final java.lang.String HASH_HEADER
public TopologyRequestValidator(BaseConfig config)
config
- the configuation objectpublic java.lang.String encodeMessage(java.lang.String body) throws java.io.IOException
body
- java.io.IOException
public java.lang.String decodeMessage(javax.servlet.http.HttpServletRequest request) throws java.io.IOException
request
- the request object for the message.java.io.IOException
- if there is a problem decoding the message or the
message is invalid.public java.lang.String decodeMessage(java.lang.String uri, org.apache.http.HttpResponse response) throws java.io.IOException
response
- the response.java.io.IOException
- if there was a problem decoding the message.public boolean isTrusted(javax.servlet.http.HttpServletRequest request)
request
- the request.public boolean isTrusted(org.apache.http.HttpResponse response)
response
- the responsepublic void trustMessage(org.apache.http.client.methods.HttpUriRequest method, java.lang.String body)
method
- the method which will have headers set after the call.body
- the body.public void trustMessage(javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request, java.lang.String body)
response
- the response.request
- the request,body
- body of the response.Copyright © 2018 The Apache Software Foundation. All rights reserved.