Package io.dropwizard.servlets.tasks
Class TaskServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- io.dropwizard.servlets.tasks.TaskServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class TaskServlet extends javax.servlet.http.HttpServletA servlet which provides access to administrativeTasks. It only responds toPOSTrequests, since mostTasks aren't side effect free, and passes along the query string parameters of the request to the task as a multimap.- See Also:
Task, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskServlet(com.codahale.metrics.MetricRegistry metricRegistry)Creates a new TaskServlet.TaskServlet(com.codahale.metrics.MetricRegistry metricRegistry, TaskConfiguration taskConfiguration)Creates a new TaskServlet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Task task)protected voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)protected voiddoPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)Collection<Task>getTasks()-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Constructor Detail
-
TaskServlet
public TaskServlet(com.codahale.metrics.MetricRegistry metricRegistry)
Creates a new TaskServlet.
-
TaskServlet
public TaskServlet(com.codahale.metrics.MetricRegistry metricRegistry, TaskConfiguration taskConfiguration)Creates a new TaskServlet.- Since:
- 2.0
-
-
Method Detail
-
add
public void add(Task task)
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
getTasks
public Collection<Task> getTasks()
-
-