public class HTTPRequestValidationHandler extends AbstractMessageHandler
Constructor and Description |
---|
HTTPRequestValidationHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
doInitialize() |
protected void |
doInvoke(MessageContext messageContext)
Evaluates whether the specified HTTP servlet request meets all requirements.
|
protected void |
evaluateContentType(javax.servlet.http.HttpServletRequest request)
Checks if the request is of the correct content type.
|
protected void |
evaluateRequestMethod(javax.servlet.http.HttpServletRequest request)
Checks if the request contains the correct request method.
|
protected void |
evaluateSecured(javax.servlet.http.HttpServletRequest request)
Checks if the request is secured.
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Get the HTTP servlet request instance being evaluated.
|
String |
getRequiredContentType()
Get the required content type.
|
String |
getRequiredRequestMethod()
Get the required request method.
|
boolean |
isRequireSecured()
Get whether request is required to be secure.
|
void |
setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
Set the HTTP servlet request instance being evaluated.
|
void |
setRequiredContentType(String contentType)
Set the required content type.
|
void |
setRequiredRequestMethod(String requestMethod)
Set the required request method.
|
void |
setRequireSecured(boolean secured)
Set whether request is required to be secure.
|
doPostInvoke, doPostInvoke, doPreInvoke, getLogPrefix, invoke
destroy, doDestroy, initialize, isDestroyed, isInitialized
public String getRequiredContentType()
public void setRequiredContentType(String contentType)
contentType
- the content typepublic String getRequiredRequestMethod()
public void setRequiredRequestMethod(String requestMethod)
requestMethod
- the required request methodpublic boolean isRequireSecured()
public void setRequireSecured(boolean secured)
secured
- true if required to be secure, false otherwisepublic javax.servlet.http.HttpServletRequest getHttpServletRequest()
public void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
request
- the request instanceprotected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize
in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.ComponentInitializationException
protected void doInvoke(MessageContext messageContext) throws MessageHandlerException
doInvoke
in class AbstractMessageHandler
messageContext
- message context being evaluatedMessageHandlerException
- thrown if the request does not meet the requirements of the handlerprotected void evaluateContentType(javax.servlet.http.HttpServletRequest request) throws MessageHandlerException
request
- the request being evaluatedMessageHandlerException
- thrown if the content type was an unexpected valueprotected void evaluateRequestMethod(javax.servlet.http.HttpServletRequest request) throws MessageHandlerException
request
- the request being evaluatedMessageHandlerException
- thrown if the request method was an unexpected valueprotected void evaluateSecured(javax.servlet.http.HttpServletRequest request) throws MessageHandlerException
request
- the request being evaluatedMessageHandlerException
- thrown if the request is not secure and was required to beCopyright © 2019. All rights reserved.