public abstract class HTTPTask extends Task implements AnnotatedAntTask, ClasspathDelegateAntTask, ConfigurableAntTask, HttpRequestInterceptor, HttpResponseInterceptor
Task
for web
API client tasks.
<HTTPTask buffer="boolean" classname="String" classpathref="Reference" description="String" taskname="String">
<classpath .../>
</HTTPTask>
Modifier and Type | Class and Description |
---|---|
static class |
HTTPTask.Delete
|
static class |
HTTPTask.Get
|
static class |
HTTPTask.Head
|
static class |
HTTPTask.NameValuePairImpl
StringAttributeType implementation that includes
NameValuePair . |
static class |
HTTPTask.Options
|
static class |
HTTPTask.Patch
|
static class |
HTTPTask.Post
|
static class |
HTTPTask.Put
|
protected static class |
HTTPTask.Request
|
description, location, project
Constructor and Description |
---|
HTTPTask() |
Modifier and Type | Method and Description |
---|---|
protected HttpClientBuilder |
builder()
Method to allow subclasses to configure the
HttpClientBuilder . |
void |
execute()
Default implementation for
Task subclasses. |
void |
init()
Default implementation for
Task
subclasses. |
protected void |
log(HttpContext context)
See
Task.log(String) . |
protected void |
log(HttpMessage message)
See
Task.log(String) . |
protected void |
log(String type,
HttpEntity entity)
See
Task.log(String) . |
void |
process(HttpRequest request,
HttpContext context) |
void |
process(HttpResponse response,
HttpContext context) |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAntTaskName
log, log, log, log, log, log, log, log, log, log, log
createClasspath, delegate, delegate, getClassForName, getClassLoader, setClassname, setClasspathref
configure
public HTTPTask()
public void init() throws BuildException
ClasspathDelegateAntTask
Task
subclasses.init
in interface ClasspathDelegateAntTask
init
in interface ConfigurableAntTask
init
in class Task
BuildException
public void execute() throws BuildException
AnnotatedAntTask
Task
subclasses. Check attributes
annotated with AntTaskAttributeConstraint
.
See AnnotatedAntTaskConfigurationChecker
.execute
in interface AnnotatedAntTask
execute
in class Task
BuildException
- If a
AntTaskAttributeConstraint.Checker
fails.protected HttpClientBuilder builder()
HttpClientBuilder
.HttpClientBuilder
.public void process(HttpRequest request, HttpContext context) throws IOException
process
in interface HttpRequestInterceptor
IOException
public void process(HttpResponse response, HttpContext context) throws IOException
process
in interface HttpResponseInterceptor
IOException
protected void log(HttpContext context)
Task.log(String)
.context
- The HttpContext
to log.protected void log(HttpMessage message)
Task.log(String)
.message
- The HttpMessage
to log.protected void log(String type, HttpEntity entity)
Task.log(String)
.type
- The entity Content-Type
(if
specified).entity
- The HttpEntity
to log.Copyright © 2015–2020 Allen D. Ball. All rights reserved.