Class RestAPIHandler

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
dev.agenor.tools.console.RestAPIHandler
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class RestAPIHandler extends jakarta.servlet.http.HttpServlet
REST API handler for web console. Endpoints: - GET /api/agents - List all agents - GET /api/agents/{id} - Get agent details - POST /api/agents/{id}/start - Start agent - POST /api/agents/{id}/stop - Stop agent - GET /api/messages - Get recent messages (with optional filters) - GET /api/deadletters - Get recently dead-lettered messages - GET /api/stats - Get runtime statistics - GET /api/health - Health check
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    RestAPIHandler(AgenorRuntime runtime, com.fasterxml.jackson.databind.ObjectMapper objectMapper, MessageHistoryService messageHistory)
    Creates a RestAPIHandler with full message history support.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    protected void
    doOptions(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    protected void
    doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doPut, doTrace, getLastModified, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RestAPIHandler

      public RestAPIHandler(AgenorRuntime runtime, com.fasterxml.jackson.databind.ObjectMapper objectMapper, MessageHistoryService messageHistory)
      Creates a RestAPIHandler with full message history support.
      Parameters:
      runtime - the Agenor runtime
      objectMapper - JSON mapper
      messageHistory - message history service, may be null
  • Method Details

    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      IOException
    • doPost

      protected void doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Overrides:
      doPost in class jakarta.servlet.http.HttpServlet
      Throws:
      IOException
    • doOptions

      protected void doOptions(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
      Overrides:
      doOptions in class jakarta.servlet.http.HttpServlet