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 Details

    • AS4XServletHandler

      public AS4XServletHandler()
      Default constructor.
      Since:
      0.9.7
  • Method Details

    • getRequestHandlerCustomizer

      public final @Nullable IAS4ServletRequestHandlerCustomizer 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 be null.
      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:
      createUnifiedResponse in interface com.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 AS4IncomingMessageMetadata and never null.
      Since:
      0.12.0
    • createResponseAbstraction

      public static @NonNull IAS4ResponseAbstraction createResponseAbstraction(@NonNull AS4UnifiedResponse aHttpResponse)
      Parameters:
      aHttpResponse - The unified response to be wrapped. May not be null.
      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 to handleRequest(IRequestWebScopeWithoutResponse, UnifiedResponse) all the member variables are resolved into parameters to make overriding simpler.
      Parameters:
      aRequestScope - The request scope. May not be null.
      aHttpResponse - The HTTP response to be filled. May not be null.
      aHandlerCustomizer - An optional callback that can be used to modify the internal AS4RequestHandler before and after processing. May be null.
      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:
      handleRequest in interface com.helger.xservlet.handler.simple.IXServletSimpleHandler
      Throws:
      Exception