Class PkiHttpsTransport

java.lang.Object
zeroecho.pki.server.http.PkiHttpsTransport
All Implemented Interfaces:
AutoCloseable

public final class PkiHttpsTransport extends Object implements AutoCloseable
Narrow lifecycle facade hiding the JDK HTTPS listener and bounded execution runtime.

The public server lifecycle uses this type only as an internal module boundary; request handlers, queues, permits and provider discovery remain package-private.

  • Method Details

    • start

      public static PkiHttpsTransport start(PkiServerConfiguration configuration, ServerRealmContext realm, PkiServerAuthenticator authenticator, Clock clock, SecureRandom random, ClassLoader loader, BooleanSupplier ready)
      Opens and starts one strictly mutual-TLS listener.
      Parameters:
      configuration - validated server configuration
      realm - shared long-lived realm
      authenticator - initialized mTLS authenticator
      clock - request-time source
      random - correlation identifier source
      loader - explicitly scoped TLS-provider loader
      ready - readiness predicate owned by the server lifecycle
      Returns:
      started bounded transport
    • resolveTls

      public static SSLContext resolveTls(PkiServerConfiguration configuration, ClassLoader loader)
      Resolves the explicitly selected TLS provider before realm resources are opened.
      Parameters:
      configuration - validated server configuration
      loader - explicitly scoped provider loader
      Returns:
      initialized JSSE context without exposing private-key material
    • startResolved

      public static PkiHttpsTransport startResolved(PkiServerConfiguration configuration, ServerRealmContext realm, PkiServerAuthenticator authenticator, Clock clock, SecureRandom random, SSLContext tls, BooleanSupplier ready)
      Starts a listener using a TLS context resolved before realm construction.
      Parameters:
      configuration - validated server configuration
      realm - shared long-lived realm
      authenticator - initialized mTLS authenticator
      clock - request-time source
      random - correlation identifier source
      tls - initialized TLS context
      ready - readiness predicate
      Returns:
      started bounded transport
    • address

      public InetSocketAddress address()
      Returns the actual bound listener address, including an allocated ephemeral port.
      Returns:
      bound administrative listener address
    • accepting

      public boolean accepting()
      Indicates whether operation admission is accepting new requests.
      Returns:
      true while new requests may be admitted
    • currentThreadIsServerWorker

      public static boolean currentThreadIsServerWorker()
      Reports the implementation-owned worker marker used to prevent lifecycle self-waits. This is not an application scheduling or authorization signal.
      Returns:
      whether the current thread is owned by a packaged server runtime
    • quiesce

      public void quiesce()
      Prevents new operation admission without closing in-flight work.
    • shutdownHook

      public Thread shutdownHook(Runnable task)
      Creates the sole process-shutdown thread through the centralized runtime.
      Parameters:
      task - finite server close action
      Returns:
      unstarted JVM shutdown hook
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown(Duration graceful)
      Stops new exchanges, grants admitted exchanges a finite drain period and then closes all bounded executors.
      Parameters:
      graceful - finite listener drain period