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 @NonNull AS4IncomingMessageMetadatacreateIncomingMessageMetadata(@NonNull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope) Create the incoming message metadata based on the provided request.static @NonNull IAS4ResponseAbstractioncreateResponseAbstraction(@NonNull AS4UnifiedResponse aHttpResponse) Create theIAS4ResponseAbstractionfor use withAS4UnifiedResponse.@NonNull AS4UnifiedResponsecreateUnifiedResponse(@NonNull com.helger.http.EHttpVersion eHTTPVersion, @NonNull com.helger.http.EHttpMethod eHTTPMethod, @NonNull jakarta.servlet.http.HttpServletRequest aHttpRequest, @NonNull com.helger.web.scope.IRequestWebScope aRequestScope) final @Nullable IAS4ServletRequestHandlerCustomizerprotected voidhandleRequest(@NonNull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @NonNull AS4UnifiedResponse aHttpResponse, @Nullable IAS4ServletRequestHandlerCustomizer aHandlerCustomizer) Handle an incoming request.final voidhandleRequest(@NonNull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @NonNull com.helger.servlet.response.UnifiedResponse aUnifiedResponse) final @NonNull AS4XServletHandlersetRequestHandlerCustomizer(@Nullable 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
public final @NonNull AS4XServletHandler setRequestHandlerCustomizer(@Nullable IAS4ServletRequestHandlerCustomizer aHandlerCustomizer) The customizer to be used.- Parameters:
aHandlerCustomizer- The new customizer. May benull.- Returns:
- this for chaining
-
createUnifiedResponse
public @NonNull AS4UnifiedResponse createUnifiedResponse(@NonNull com.helger.http.EHttpVersion eHTTPVersion, @NonNull com.helger.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
@OverrideOnDemand protected @NonNull 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
public static @NonNull 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
-