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

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

      @Nonnull public static 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