Package com.helger.phase4.servlet
Class AS4XServletHandler
java.lang.Object
com.helger.phase4.servlet.AS4XServletHandler
- All Implemented Interfaces:
com.helger.xservlet.handler.IXServletBasicHandler,com.helger.xservlet.handler.simple.IXServletSimpleHandler
public class AS4XServletHandler
extends Object
implements com.helger.xservlet.handler.simple.IXServletSimpleHandler
Main handler for the
AS4Servlet- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AS4IncomingMessageMetadatacreateIncomingMessageMetadata(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope) Create the incoming message metadata based on the provided request.static IAS4ResponseAbstractioncreateResponseAbstraction(AS4UnifiedResponse aHttpResponse) Create theIAS4ResponseAbstractionfor use withAS4UnifiedResponse.createUnifiedResponse(com.helger.http.EHttpVersion eHTTPVersion, com.helger.commons.http.EHttpMethod eHTTPMethod, jakarta.servlet.http.HttpServletRequest aHttpRequest, com.helger.web.scope.IRequestWebScope aRequestScope) protected voidhandleRequest(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, AS4UnifiedResponse aHttpResponse, IAS4ServletRequestHandlerCustomizer aHandlerCustomizer) Handle an incoming request.final voidhandleRequest(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, com.helger.servlet.response.UnifiedResponse aUnifiedResponse) final AS4XServletHandlersetRequestHandlerCustomizer(IAS4ServletRequestHandlerCustomizer aHandlerCustomizer) The customizer to be used.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.xservlet.handler.IXServletBasicHandler
onServletDestroy, onServletInitMethods inherited from interface com.helger.xservlet.handler.simple.IXServletSimpleHandler
getLastModificationDateTime, getSupportedETag, initRequestState, onException, onRequestBegin, onRequestEnd
-
Constructor Details
-
AS4XServletHandler
public AS4XServletHandler()Default constructor.- Since:
- 0.9.7
-
-
Method Details
-
getRequestHandlerCustomizer
- Returns:
- The additional customizer. May be
null.
-
setRequestHandlerCustomizer
@Nonnull public final AS4XServletHandler setRequestHandlerCustomizer(@Nullable IAS4ServletRequestHandlerCustomizer aHandlerCustomizer) The customizer to be used.- Parameters:
aHandlerCustomizer- The new customizer. May benull.- Returns:
- this for chaining
-
createUnifiedResponse
@Nonnull public AS4UnifiedResponse createUnifiedResponse(@Nonnull com.helger.http.EHttpVersion eHTTPVersion, @Nonnull com.helger.commons.http.EHttpMethod eHTTPMethod, @Nonnull jakarta.servlet.http.HttpServletRequest aHttpRequest, @Nonnull com.helger.web.scope.IRequestWebScope aRequestScope) - Specified by:
createUnifiedResponsein interfacecom.helger.xservlet.handler.simple.IXServletSimpleHandler
-
createIncomingMessageMetadata
@Nonnull @OverrideOnDemand protected AS4IncomingMessageMetadata createIncomingMessageMetadata(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope) Create the incoming message metadata based on the provided request. This method may be overridden by sub-classes to customize the header generation e.g. when sitting behind a proxy or the like.- Parameters:
aRequestScope- The request scope to use.- Returns:
- New
AS4IncomingMessageMetadataand nevernull. - Since:
- 0.12.0
-
createResponseAbstraction
@Nonnull public static IAS4ResponseAbstraction createResponseAbstraction(@Nonnull AS4UnifiedResponse aHttpResponse) Create theIAS4ResponseAbstractionfor use withAS4UnifiedResponse.- Parameters:
aHttpResponse- The unified response to be wrapped. May not benull.- Returns:
- Never
null.
-
handleRequest
protected void handleRequest(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull AS4UnifiedResponse aHttpResponse, @Nullable IAS4ServletRequestHandlerCustomizer aHandlerCustomizer) throws Exception Handle an incoming request. Compared tohandleRequest(IRequestWebScopeWithoutResponse, UnifiedResponse)all the member variables are resolved into parameters to make overriding simpler.- Parameters:
aRequestScope- The request scope. May not benull.aHttpResponse- The HTTP response to be filled. May not benull.aHandlerCustomizer- An optional callback that can be used to modify the internalAS4RequestHandlerbefore and after processing. May benull.- Throws:
Exception- In case of a processing error- Since:
- 1.3.1
-
handleRequest
public final void handleRequest(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull com.helger.servlet.response.UnifiedResponse aUnifiedResponse) throws Exception - Specified by:
handleRequestin interfacecom.helger.xservlet.handler.simple.IXServletSimpleHandler- Throws:
Exception
-