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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe charset used during URL encoding.protected booleanIf set to true - ignore the constraint of the first line of the response message that must be "OK -".protected StringThe login password for theManagerapplication.protected StringThe URL of theManagerapplication to be used.protected StringThe login username for theManagerapplication.Fields inherited from class BaseRedirectorHelperTask
alwaysLog, failOnError, redirectErrStream, redirector, redirectorConfigured, redirectorElement, redirectOutput, redirectOutStreamFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a new instance of this task. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute the specified command.voidExecute the specified command, based on the configured properties.voidexecute(String command, InputStream istream, String contentType, long contentLength) Execute the specified command, based on the configured properties.Returns the charset used during URL encoding.Returns the login password for the Manager application.getUrl()Returns the URL of the Manager application to be used.Returns the login username for the Manager application.booleanReturns whether the constraint on the first line of the response message is ignored.voidsetCharset(String charset) Sets the charset used during URL encoding.voidsetIgnoreResponseConstraint(boolean ignoreResponseConstraint) Sets whether the constraint on the first line of the response message is ignored.voidsetPassword(String password) Sets the login password for the Manager application.voidSets the URL of the Manager application to be used.voidsetUsername(String username) Sets the login username for the Manager application.Methods inherited from class BaseRedirectorHelperTask
addConfiguredRedirector, closeRedirector, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, handleOutput, isFailOnError, openRedirector, setAlwaysLog, setAppend, setCreateEmptyFiles, setError, setErrorProperty, setFailonerror, setLogError, setOutput, setOutputpropertyMethods 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, setTaskTypeMethods 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 theManagerapplication. -
url
The URL of theManagerapplication to be used. -
username
The login username for theManagerapplication. -
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
protected AbstractCatalinaTask()Construct a new instance of this task.
-
-
Method Details
-
getCharset
-
setCharset
Sets the charset used during URL encoding.- Parameters:
charset- the charset to set
-
getPassword
Returns the login password for the Manager application.- Returns:
- the password
-
setPassword
Sets the login password for the Manager application.- Parameters:
password- the password to set
-
getUrl
-
setUrl
Sets the URL of the Manager application to be used.- Parameters:
url- the url to set
-
getUsername
Returns the login username for the Manager application.- Returns:
- the username
-
setUsername
Sets the login username for the Manager application.- Parameters:
username- the username to set
-
isIgnoreResponseConstraint
public boolean isIgnoreResponseConstraint()Returns whether the constraint on the first line of the response message is ignored.- Returns:
- true if the constraint is ignored
-
setIgnoreResponseConstraint
public void setIgnoreResponseConstraint(boolean ignoreResponseConstraint) Sets whether the constraint on the first line of the response message is ignored.- Parameters:
ignoreResponseConstraint- true to ignore the constraint
-
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:
executein 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
-