Class TopologyRequestValidator
java.lang.Object
org.apache.sling.discovery.base.connectors.ping.TopologyRequestValidator
Request Validator helper.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionTopologyRequestValidator(BaseConfig config) Create a TopologyRequestValidator.
- 
Method SummaryModifier and TypeMethodDescriptiondecodeMessage(String uri, org.apache.http.HttpResponse response) Decode a response from the server.decodeMessage(javax.servlet.http.HttpServletRequest request) Decode a message sent from the client.encodeMessage(String body) Encodes a request returning the encoded bodybooleanisTrusted(javax.servlet.http.HttpServletRequest request) Is the request from the client trusted, based on the signature headers.booleanisTrusted(org.apache.http.HttpResponse response) Is the response from the server to be trusted by the client.voidtrustMessage(javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request, String body) Trust a response message sent from the server to the client.voidtrustMessage(org.apache.http.client.methods.HttpUriRequest method, String body) Trust a message on the client before sending, only if trust is enabled.
- 
Field Details- 
SIG_HEADER- See Also:
 
- 
HASH_HEADER- See Also:
 
 
- 
- 
Constructor Details- 
TopologyRequestValidatorCreate a TopologyRequestValidator.- Parameters:
- config- the configuation object
 
 
- 
- 
Method Details- 
encodeMessageEncodes a request returning the encoded body- Parameters:
- body-
- Returns:
- the encoded body.
- Throws:
- IOException
 
- 
decodeMessageDecode a message sent from the client.- Parameters:
- request- the request object for the message.
- Returns:
- the message in clear text.
- Throws:
- IOException- if there is a problem decoding the message or the message is invalid.
 
- 
decodeMessageDecode a response from the server.- Parameters:
- response- the response.
- Returns:
- the message in clear text.
- Throws:
- IOException- if there was a problem decoding the message.
 
- 
isTrustedpublic boolean isTrusted(javax.servlet.http.HttpServletRequest request) Is the request from the client trusted, based on the signature headers.- Parameters:
- request- the request.
- Returns:
- true if trusted, or true if this component is disabled.
 
- 
isTrustedpublic boolean isTrusted(org.apache.http.HttpResponse response) Is the response from the server to be trusted by the client.- Parameters:
- response- the response
- Returns:
- true if trusted, or true if this component is disabled.
 
- 
trustMessageTrust a message on the client before sending, only if trust is enabled.- Parameters:
- method- the method which will have headers set after the call.
- body- the body.
 
- 
trustMessagepublic void trustMessage(javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request, String body) Trust a response message sent from the server to the client.- Parameters:
- response- the response.
- request- the request,
- body- body of the response.
 
 
-