Package dev.agenor.tools.console
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
ConstructorsConstructorDescriptionRestAPIHandler(AgenorRuntime runtime, com.fasterxml.jackson.databind.ObjectMapper objectMapper, MessageHistoryService messageHistory) Creates a RestAPIHandler with full message history support. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) protected voiddoOptions(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) protected voiddoPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doPut, doTrace, getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
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 runtimeobjectMapper- JSON mappermessageHistory- 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:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOException
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException - Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Throws:
IOException
-
doOptions
protected void doOptions(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) - Overrides:
doOptionsin classjakarta.servlet.http.HttpServlet
-