com.ibm.websphere.ant.tasks
Class WsAdmin

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--com.ibm.websphere.ant.tasks.WsAdmin
Direct Known Subclasses:
InstallApplication, ListApplications, StartApplication, StopApplication, UninstallApplication

public class WsAdmin
extends org.apache.tools.ant.Task

The wsadmin task executes the WebSphere command-line administration tool with the specified arguments. The structure of the wsadmin task is shown below:

<wsadmin wasHome="location of websphere installation" command="command to be passed to the script processor" properties="java properties file containing attributes to set in the JVM System properties" profile="a script file to be executed before the main command or file" script="a set of commands in a file to be passed to the script processor" lang="the language to be used to interpret scripts." conntype="specifies the type of connection to be used." host="the host to connect to" port="the port on the host to connect to" user="user ID to authenticate with" password="password to authenticate with"> <arg value=""/> . . . <arg value=""/> </wsadmin> The wasHome attribute is optional and contains the location of the WebSphere Installation Directory.
The command attribute is required, unless script is specified, and it contains the command to be passed to the script processor
The properties attribute is optional and it contains a java properties file containing attributes to set in the JVM System properties
The profile attribute is optional and it contains a script file to be executed before the main command or file
The script attribute is required, unless command is specified, and it contains a set of commands in a file to be passed to the script processor
The lang attribute is optional and it contains the language to be used to interpret scripts. The supported values are jacl, javascript, and jpython.
The conntype attribute is optional and it specifies the type of connection to be used. The Default type is SOAP. The valid values are SOAP, RMI, and NONE. NONE means that no server connection is made. The host attribute is optional and only specified if the conntype is specified. It contains the hostname of the machine to connect to
The port attribute is optional and only specified if the conntype is specified. It contains the port on the host to connect to
The user attribute is optional and contains the user ID to authenticate with
The password attribute is optional and contains the password to authenticate with

The task can contain 0 or more nested arg elements that contain arguments that are passed to the script.


To use this task, add the following to your Ant build.xml <taskdef name="wsadmin" classname="com.ibm.websphere.ant.tasks.WsAdmin"/>


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
WsAdmin()
          Constructor for WsEjbDeploy
 
Method Summary
 org.apache.tools.ant.types.Commandline.Argument createArg()
          Creates a nested arg element.
 void execute()
           
 void setCommand(java.lang.String command)
          Sets the command.
 void setConntype(java.lang.String conntype)
          Sets the conntype.
 void setFailonerror(boolean failonerror)
          Sets the failonerror.
 void setHost(java.lang.String host)
          Sets the host.
 void setInstance(java.lang.String str)
           
 void setLang(java.lang.String lang)
          Sets the lang.
 void setPassword(java.lang.String password)
          Sets the password.
 void setPort(java.lang.String port)
          Sets the port.
 void setProfile(java.lang.String profile)
          Sets the profile.
 void setProperties(java.lang.String properties)
          Sets the properties.
 void setScript(java.lang.String script)
          Sets the script.
 void setUser(java.lang.String user)
          Sets the user.
 void setWasHome(java.lang.String wasHome)
          Sets the wasHome.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
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

WsAdmin

public WsAdmin()
Constructor for WsEjbDeploy

Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
See Also:
Task.execute()

setWasHome

public void setWasHome(java.lang.String wasHome)
Sets the wasHome.

Parameters:
wasHome - The wasHome to set

setFailonerror

public void setFailonerror(boolean failonerror)
Sets the failonerror.

Parameters:
failonerror - The failonerror to set

setCommand

public void setCommand(java.lang.String command)
Sets the command.

Parameters:
command - The command to set

setProperties

public void setProperties(java.lang.String properties)
Sets the properties.

Parameters:
properties - The properties to set

setProfile

public void setProfile(java.lang.String profile)
Sets the profile.

Parameters:
profile - The profile to set

setScript

public void setScript(java.lang.String script)
Sets the script.

Parameters:
script - The script to set

setLang

public void setLang(java.lang.String lang)
Sets the lang.

Parameters:
lang - The lang to set

setConntype

public void setConntype(java.lang.String conntype)
Sets the conntype.

Parameters:
conntype - The conntype to set

setHost

public void setHost(java.lang.String host)
Sets the host.

Parameters:
host - The host to set

setPort

public void setPort(java.lang.String port)
Sets the port.

Parameters:
port - The port to set

setUser

public void setUser(java.lang.String user)
Sets the user.

Parameters:
user - The user to set

setInstance

public void setInstance(java.lang.String str)

setPassword

public void setPassword(java.lang.String password)
Sets the password.

Parameters:
password - The password to set

createArg

public org.apache.tools.ant.types.Commandline.Argument createArg()
Creates a nested arg element.



 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.