Package io.dropwizard.servlets.tasks
Class PostBodyTask
- java.lang.Object
-
- io.dropwizard.servlets.tasks.Task
-
- io.dropwizard.servlets.tasks.PostBodyTask
-
- Direct Known Subclasses:
EchoTask
public abstract class PostBodyTask extends Task
A task which can be performed via the admin interface and provides the post body of the request.- See Also:
Task
,TaskServlet
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PostBodyTask(String name)
Create a new task with the given name.protected
PostBodyTask(String name, String responseContentType)
Create a new task with the given name and response content type
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
execute(Map<String,List<String>> parameters, PrintWriter output)
Deprecated.Useexecute(Map, String, PrintWriter)
or inherit from Task instead.abstract void
execute(Map<String,List<String>> parameters, String body, PrintWriter output)
-
Methods inherited from class io.dropwizard.servlets.tasks.Task
getName, getResponseContentType
-
-
-
-
Constructor Detail
-
PostBodyTask
protected PostBodyTask(String name)
Create a new task with the given name.- Parameters:
name
- the task's name
-
-
Method Detail
-
execute
public abstract void execute(Map<String,List<String>> parameters, String body, PrintWriter output) throws Exception
- Parameters:
parameters
- the query string parametersbody
- the plain text request bodyoutput
- aPrintWriter
wrapping the output stream of the task- Throws:
Exception
-
execute
@Deprecated public void execute(Map<String,List<String>> parameters, PrintWriter output) throws Exception
Deprecated.Useexecute(Map, String, PrintWriter)
or inherit from Task instead.Deprecated, useexecute(Map, String, PrintWriter)
or inherit from Task instead.- Specified by:
execute
in classTask
- Parameters:
parameters
- the query string parametersoutput
- aPrintWriter
wrapping the output stream of the task- Throws:
Exception
-
-