public class HTTPRequestValidationHandler extends AbstractMessageHandler
| Modifier and Type | Field and Description |
|---|---|
private javax.servlet.http.HttpServletRequest |
httpServletRequest
The HTTP servlet request being evaluated.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
requiredContentType
Expected content type of the request.
|
private String |
requiredRequestMethod
Expected method of the request.
|
private boolean |
requireSecured
Whether the request must be secure.
|
| 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, getActivationCondition, getLogPrefix, invoke, setActivationConditiondestroy, doDestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull private final org.slf4j.Logger log
@Nullable private String requiredContentType
@Nullable private String requiredRequestMethod
private boolean requireSecured
@NonnullAfterInit private javax.servlet.http.HttpServletRequest httpServletRequest
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 ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected void doInvoke(MessageContext messageContext) throws MessageHandlerException
doInvoke in class AbstractMessageHandlermessageContext - 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 © 1999–2019 Shibboleth Consortium. All rights reserved.