Package org.opensaml.messaging.handler
Class AbstractHttpServletRequestMessageHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.messaging.handler.AbstractHttpServletRequestMessageHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
- Direct Known Subclasses:
BaseSAMLSimpleSignatureSecurityHandler,HttpServletRequestValidationHandler,ReceivedEndpointSecurityHandler
Base class for message handlers that require access to an
HttpServletRequest.- Since:
- 5.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFlag for whether to check for servlet request during init.private NonnullSupplier<HttpServletRequest>The HttpServletRequest being processed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidGet the HTTP servlet request being processed.Get the supplier for HTTP request if available.booleanGet whether {AbstractInitializableComponent.initialize()should throw an exception ifgetHttpServletRequest()returns null.voidsetCheckDuringInit(boolean flag) Set whether {AbstractInitializableComponent.initialize()should throw an exception ifgetHttpServletRequest()returns null.voidsetHttpServletRequestSupplier(NonnullSupplier<HttpServletRequest> requestSupplier) Set the current HTTP request Supplier.Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doInvoke, doPostInvoke, doPostInvoke, doPreInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
checkDuringInit
private boolean checkDuringInitFlag for whether to check for servlet request during init. -
httpServletRequestSupplier
The HttpServletRequest being processed.
-
-
Constructor Details
-
AbstractHttpServletRequestMessageHandler
public AbstractHttpServletRequestMessageHandler()Constructor.
-
-
Method Details
-
isCheckDuringInit
public boolean isCheckDuringInit()Get whether {AbstractInitializableComponent.initialize()should throw an exception ifgetHttpServletRequest()returns null.- Returns:
- whether a null request should fail initialization
-
setCheckDuringInit
public void setCheckDuringInit(boolean flag) Set whether {AbstractInitializableComponent.initialize()should throw an exception ifgetHttpServletRequest()returns null.Defaults to true.
- Parameters:
flag- flag to set
-
getHttpServletRequest
Get the HTTP servlet request being processed.The return annotation is valid only in the default state, when
isCheckDuringInit()is true.- Returns:
- Returns the request.
-
getHttpServletRequestSupplier
Get the supplier for HTTP request if available.The return annotation is valid only in the default state, when
isCheckDuringInit()is true.- Returns:
- current HTTP request
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-