java.lang.Object
one.jpro.platform.auth.core.http.impl.HttpServerImpl
All Implemented Interfaces:
AutoCloseable, HttpServer

public final class HttpServerImpl extends Object implements HttpServer
Implementation of the HttpServer interface when running the application in a desktop/device environment.
  • Constructor Details

    • HttpServerImpl

      public HttpServerImpl(@Nullable @Nullable javafx.stage.Stage stage, @NotNull @NotNull HttpOptions options) throws IOException
      Creates HTTP server.
      Parameters:
      options - the HTTP options
      Throws:
      IOException - if an error occurs
  • Method Details

    • start

      public void start()
      Description copied from interface: HttpServer
      Starts the server. If the application is running in a browser via JPro server, then this method does nothing.
      Specified by:
      start in interface HttpServer
    • stop

      public void stop()
      Description copied from interface: HttpServer
      Stops the server. If the application is running in a browser via JPro server, then this method does nothing.
      Specified by:
      stop in interface HttpServer
    • getServerHost

      public String getServerHost()
      Description copied from interface: HttpServer
      Return the server host.
      Specified by:
      getServerHost in interface HttpServer
      Returns:
      the server host
    • getServerPort

      public int getServerPort()
      Description copied from interface: HttpServer
      Return the server port.
      Specified by:
      getServerPort in interface HttpServer
      Returns:
      the server port
    • getFullRequestedURL

      public String getFullRequestedURL()
      Description copied from interface: HttpServer
      Return the full URL (with query string) the client used to request the server.
      Specified by:
      getFullRequestedURL in interface HttpServer
      Returns:
      the URL
    • openURL

      public CompletableFuture<String> openURL(@NotNull @NotNull String url)
      Description copied from interface: HttpServer
      Opens the given URL string in the browser.
      Specified by:
      openURL in interface HttpServer
      Parameters:
      url - the URL string to open