|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task net.sf.fikin.ant.httpclientanttask.BaseAntMethod
public abstract class BaseAntMethod
Encapsulates all common to all tasks properties
All Ant tasks are backed by a single 8static) HttpClient instance. This allows for creating multiple-tags operations with same http source which allosw for a more complex schenarious such as authenticate first, store the session as coockies and then do some hot and/or get operations. This also has an disadvantage of possible interferince if one has to deal with more than one source. In those cases, one has to "shutdown" the HttpClient instance the first time it starts operating with a new host. This effectively will erase all previous session data and create a fresh HttpClient instance. created on Feb 11, 2006
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.Task |
---|
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
project |
Constructor Summary | |
---|---|
BaseAntMethod()
|
Method Summary | |
---|---|
void |
addProperty(org.apache.tools.ant.types.Parameter p)
set HttpClient property |
protected void |
after_execute_method()
do something after @link #execute_method() is called and before connection is release |
protected void |
before_execute_method()
do something before @link #execute_method() is called |
protected void |
check()
check that url has been set and coockies policy is a valid one |
protected void |
clearHttpClient()
clear static HttpClient object after execution this is used in order to free mememory generally not needed though |
AntProxy |
createProxy()
create proxy data |
AntCredentials |
createUserCredentials()
create user credentials (http authentication) |
protected void |
execute_method()
actual method execution |
void |
execute()
execute the task : check method-type and move to a particular handling |
int |
getConnectionTimeout()
what is the connection timeout before retrying, by default 5000ms |
java.lang.String |
getCookiePolicy()
get the coockies policy |
boolean |
getFailOnError()
get fail on error |
protected org.apache.commons.httpclient.HttpClient |
getHttpClient()
instantiate (if needed) and return the common (static) HttpClient object |
protected org.apache.commons.httpclient.HttpMethod |
getHttpMethod()
get the HttpClient class of this method |
java.util.HashSet |
getProperties()
get HttpClient properties |
AntProxy |
getProxy()
get given proxy data |
int |
getRetryAttempts()
get how many times to retry connecting to the host, by default 5 |
boolean |
getShutdown()
is the HttpClient to be shutdown or not |
boolean |
getSslAcceptUntrusted()
get SSL accept untrusted certificates |
java.lang.String |
getUrl()
get method's url |
AntCredentials |
getUserCredentials()
get user's authenticaiton data |
protected abstract org.apache.commons.httpclient.HttpMethod |
newHttpMethod(java.lang.String url)
template method, all subclasses must define the right HttpClient object instantiated |
void |
setConnectionTimeout(int ms)
set connection timeout before retrying, by default 5000ms |
void |
setCookiePolicy(java.lang.String policy)
set coockies policy, one of: compatibility - The policy that provides high degree of compatibilty with common cookie management of popular HTTP agents ignoreCookies - The policy that ignores cookies default - The default cookie policy netscape - The Netscape cookie draft compliant policy rfc2109 - The RFC 2109 compliant policy by default it is "compatibility" |
void |
setFailOnError(boolean fail)
set fail on error, by default true |
protected void |
setHttpMethod(org.apache.commons.httpclient.HttpMethod m)
set the HttpMethod object |
protected void |
setProperties(org.apache.commons.httpclient.HttpMethod method)
set HttpClient properties (settings) |
protected void |
setProxy()
set proxy and credentials |
void |
setRetryAttempts(int cnt)
set how many times to retry the operation if failing because of communication failures, by default 5 |
void |
setShutdown(boolean shutdown)
shutdown current HttpClient instance. |
void |
setSslAcceptUntrusted(boolean trust)
set SSL accept-untrusted or self-signed (certificates) option, by default it is false |
void |
setUrl(java.lang.String url)
method's url |
protected void |
setUserCredentials()
set user credentials |
Methods inherited from class org.apache.tools.ant.Task |
---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
getProject, setProject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseAntMethod()
Method Detail |
---|
public void setUrl(java.lang.String url)
url
- of the methodpublic java.lang.String getUrl()
public void setFailOnError(boolean fail)
fail
- if truepublic boolean getFailOnError()
public void setRetryAttempts(int cnt)
cnt
- ow many times to retry connecting to the hostpublic int getRetryAttempts()
public void setShutdown(boolean shutdown)
shutdown
- in case it is truepublic boolean getShutdown()
public void setSslAcceptUntrusted(boolean trust)
trust
- if truepublic boolean getSslAcceptUntrusted()
public int getConnectionTimeout()
public void setConnectionTimeout(int ms)
ms
- to timeoutpublic AntCredentials createUserCredentials()
public AntCredentials getUserCredentials()
public AntProxy createProxy()
public AntProxy getProxy()
public void addProperty(org.apache.tools.ant.types.Parameter p)
p
- public java.util.HashSet getProperties()
public void setCookiePolicy(java.lang.String policy)
policy
- public java.lang.String getCookiePolicy()
protected org.apache.commons.httpclient.HttpMethod getHttpMethod()
protected void setHttpMethod(org.apache.commons.httpclient.HttpMethod m)
m
- protected org.apache.commons.httpclient.HttpClient getHttpClient()
protected abstract org.apache.commons.httpclient.HttpMethod newHttpMethod(java.lang.String url)
protected void clearHttpClient()
protected void check() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected void execute_method() throws org.apache.tools.ant.BuildException, org.apache.commons.httpclient.HttpException, java.io.IOException
org.apache.tools.ant.BuildException
org.apache.commons.httpclient.HttpException
java.io.IOException
protected void before_execute_method() throws org.apache.tools.ant.BuildException, org.apache.commons.httpclient.HttpException, java.io.IOException
org.apache.tools.ant.BuildException
org.apache.commons.httpclient.HttpException
java.io.IOException
protected void after_execute_method() throws org.apache.tools.ant.BuildException, org.apache.commons.httpclient.HttpException, java.io.IOException
org.apache.tools.ant.BuildException
org.apache.commons.httpclient.HttpException
java.io.IOException
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
protected void setUserCredentials()
protected void setProxy()
protected void setProperties(org.apache.commons.httpclient.HttpMethod method)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |