Package org.apache.catalina.ant
Class AbstractCatalinaTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.catalina.ant.BaseRedirectorHelperTask
org.apache.catalina.ant.AbstractCatalinaTask
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AbstractCatalinaCommandTask
,FindLeaksTask
,JKStatusUpdateTask
,JMXGetTask
,JMXQueryTask
,JMXSetTask
,ListTask
,ResourcesTask
,ServerinfoTask
,SslConnectorCiphersTask
,ThreaddumpTask
,VminfoTask
Abstract base class for Ant tasks that interact with the Manager web application for dynamically deploying
and undeploying applications. These tasks require Ant 1.4 or later.
- Since:
- 4.1
- Author:
- Craig R. McClanahan
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The charset used during URL encoding.protected boolean
If set to true - ignore the constraint of the first line of the response message that must be "OK -".protected String
The login password for theManager
application.protected String
The URL of theManager
application to be used.protected String
The login username for theManager
application.Fields inherited from class org.apache.catalina.ant.BaseRedirectorHelperTask
alwaysLog, failOnError, redirectErrStream, redirector, redirectorConfigured, redirectorElement, redirectOutput, redirectOutStream
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Execute the specified command.void
Execute the specified command, based on the configured properties.void
execute
(String command, InputStream istream, String contentType, long contentLength) Execute the specified command, based on the configured properties.getUrl()
boolean
void
setCharset
(String charset) void
setIgnoreResponseConstraint
(boolean ignoreResponseConstraint) void
setPassword
(String password) void
void
setUsername
(String username) Methods inherited from class org.apache.catalina.ant.BaseRedirectorHelperTask
addConfiguredRedirector, closeRedirector, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, handleOutput, isFailOnError, openRedirector, setAlwaysLog, setAppend, setCreateEmptyFiles, setError, setErrorProperty, setFailonerror, setLogError, setOutput, setOutputproperty
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleInput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
charset
The charset used during URL encoding. -
password
The login password for theManager
application. -
url
The URL of theManager
application to be used. -
username
The login username for theManager
application. -
ignoreResponseConstraint
protected boolean ignoreResponseConstraintIf set to true - ignore the constraint of the first line of the response message that must be "OK -".When this attribute is set to
false
(the default), the first line of server response is expected to start with "OK -". If it does not then the task is considered as failed and the first line is treated as an error message.When this attribute is set to
true
, the first line of the response is treated like any other, regardless of its text.
-
-
Constructor Details
-
AbstractCatalinaTask
public AbstractCatalinaTask()
-
-
Method Details
-
getCharset
-
setCharset
-
getPassword
-
setPassword
-
getUrl
-
setUrl
-
getUsername
-
setUsername
-
isIgnoreResponseConstraint
public boolean isIgnoreResponseConstraint() -
setIgnoreResponseConstraint
public void setIgnoreResponseConstraint(boolean ignoreResponseConstraint) -
execute
public void execute() throws org.apache.tools.ant.BuildExceptionExecute the specified command. This logic only performs the common attribute validation required by all subclasses; it does not perform any functional logic directly.- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
- if a validation error occurs
-
execute
Execute the specified command, based on the configured properties.- Parameters:
command
- Command to be executed- Throws:
org.apache.tools.ant.BuildException
- if an error occurs
-
execute
public void execute(String command, InputStream istream, String contentType, long contentLength) throws org.apache.tools.ant.BuildException Execute the specified command, based on the configured properties. The input stream will be closed upon completion of this task, whether it was executed successfully or not.- Parameters:
command
- Command to be executedistream
- InputStream to include in an HTTP PUT, if anycontentType
- Content type to specify for the input, if anycontentLength
- Content length to specify for the input, if any- Throws:
org.apache.tools.ant.BuildException
- if an error occurs
-