Class OrchestraHttpServer

java.lang.Object
com.iantapply.orchestra.web.OrchestraHttpServer
All Implemented Interfaces:
AutoCloseable

public final class OrchestraHttpServer extends Object implements AutoCloseable
Small authenticated HTTP server exposing health and Prometheus metrics.
  • Constructor Details

    • OrchestraHttpServer

      public OrchestraHttpServer(InetSocketAddress address, MetricsRegistry metrics, Map<String,Actor> tokens, OrchestraHttpServer.EventTrigger eventTrigger) throws IOException
      Creates the HTTP listener without starting it.
      Parameters:
      address - bind address
      metrics - metrics registry exposed at /metrics
      tokens - bearer-token to actor mappings
      eventTrigger - callback that creates an immediate event execution
      Throws:
      IOException - when the listening server cannot be created
    • OrchestraHttpServer

      public OrchestraHttpServer(InetSocketAddress address, MetricsRegistry metrics, Map<String,Actor> tokens, OrchestraHttpServer.EventTrigger eventTrigger, AuditRepository audit, Clock clock) throws IOException
      Creates the HTTP listener with durable operation auditing.
      Parameters:
      address - bind address
      metrics - metrics registry exposed at /metrics
      tokens - bearer-token to actor mappings
      eventTrigger - callback that creates an immediate event execution
      audit - destination for successful operator actions
      clock - audit timestamp source
      Throws:
      IOException - when the listening server cannot be created
  • Method Details

    • start

      public void start()
      Starts accepting HTTP requests.
    • close

      public void close()
      Stops accepting requests after a one-second grace period.
      Specified by:
      close in interface AutoCloseable