Class ConnectionExtractor

java.lang.Object
de.espirit.firstspirit.web.ConnectionExtractor

public class ConnectionExtractor extends Object
This class may be used to extract the current Connection associated with a HttpServletRequest.
Since:
5.2.1604
  • Constructor Details

    • ConnectionExtractor

      public ConnectionExtractor()
  • Method Details

    • extractConnectionFromRequest

      @Nullable public static @Nullable Connection extractConnectionFromRequest(@NotNull @NotNull jakarta.servlet.http.HttpServletRequest request)
      Extracts the current established Connection to the FirstSpirit server from an HttpServletRequest. If the HTTP session is an de.espirit.firstspirit.io.servlet.HttpSubSession, the connection for the subsession will be returned instead of the one opened by the main HTTP session.

      If the connection can not be found or it is not established at the moment, null is returned.

      Parameters:
      request - The servlet request to extract the connection from, must not be null.
      Returns:
      the established connection associated with the request. May be null if no connection is found or if it is not established.
      Since:
      5.2.1604