Package io.dropwizard.servlets.tasks
Class Task
java.lang.Object
io.dropwizard.servlets.tasks.Task
- Direct Known Subclasses:
GarbageCollectionTask
,LogConfigurationTask
,PostBodyTask
,SslReloadTask
An arbitrary administrative task which can be performed via the admin interface.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Task
Create a new task with the given name.- Parameters:
name
- the task's name
-
Task
Create a new task with the given name and response content type- Parameters:
name
- the task's nameresponseContentType
- the task's response content type- Since:
- 2.0
-
-
Method Details
-
getName
Returns the task's name,- Returns:
- the task's name
-
getResponseContentType
Returns the task's response content type.- Returns:
- the task's response content type
- Since:
- 2.0
-
execute
public abstract void execute(Map<String, List<String>> parameters, PrintWriter output) throws ExceptionExecutes the task.- Parameters:
parameters
- the query string parametersoutput
- aPrintWriter
wrapping the output stream of the task- Throws:
Exception
- if something goes wrong
-