Class ManagementApiHandler

java.lang.Object
com.loomcache.server.management.ManagementApiHandler

public final class ManagementApiHandler extends Object
Management REST API handler for the lightweight web UI dashboard.

Provides endpoints for:

  • Cluster topology (node health, partition ownership, leaders)
  • Data structure browser (list structures, browse entries with pagination)
  • Metrics aggregation (ops/sec, latency, memory)
  • Configuration viewer

All responses are JSON. Thread-safe.

Since:
2.0
  • Constructor Details

    • ManagementApiHandler

      public ManagementApiHandler(@NonNull DataStructureRegistry registry, int instanceNumber, @Nullable Supplier<Map<String,Object>> clusterTopologySupplier, @Nullable Supplier<Map<String,Object>> metricsSupplier, @Nullable Supplier<Map<String,Object>> configSupplier)
      Parameters:
      registry - the data structure registry
      instanceNumber - the node instance number
      clusterTopologySupplier - optional supplier for cluster topology info
      metricsSupplier - optional supplier for metrics
      configSupplier - optional supplier for configuration
  • Method Details

    • route

      public void route(@NonNull HttpExchange exchange, @NonNull String path) throws IOException
      Route a management API request.
      Parameters:
      exchange - the HTTP exchange
      path - the request path (after /api/v1/management/)
      Throws:
      IOException
    • serveDashboard

      public void serveDashboard(@NonNull HttpExchange exchange) throws IOException
      Serve the embedded HTML dashboard page.
      Throws:
      IOException