Methods Summary |
---|
protected void | checkConfiguration()
if (servers.size() == 0) {
String msg = "At least one server must be specified.";
throw new BuildException(msg, getLocation());
}
Iterator it = servers.iterator();
while (it.hasNext()) {
Server aServer = (Server)it.next();
checkConfiguration(server);
}
|
protected void | checkConfiguration(org.apache.tools.ant.taskdefs.optional.iplanet.IasAdmin$Server aServer)
if (aServer.getPassword() == null) {
String msg = "A password must be specified for each server. A "
+ "password for " + aServer.getHost() + " was "
+ "not specified.";
throw new BuildException(msg, getLocation());
}
|
public org.apache.tools.ant.taskdefs.optional.iplanet.IasAdmin$Server | createServer()
log("createServer", Project.MSG_DEBUG);
Server aServer = new Server(server);
servers.add(aServer);
return aServer;
|
protected void | execIasCommand(java.lang.String command)
log("Executing: " + command, Project.MSG_INFO);
try {
Path iasClasspath = new Path(getProject(), getIasClasspath());
iasClasspath.append(Path.systemClasspath);
log("Using classpath: " + iasClasspath.toString(), Project.MSG_DEBUG);
ClassLoader antClassLoader = new AntClassLoader(getProject(), iasClasspath);
Class inputsAndOutputs =
Class.forName(CLASS_INPUTS_AND_OUTPUTS, true, antClassLoader);
Class iasAdminMain =
Class.forName(CLASS_IAS_ADMIN_MAIN, true, antClassLoader);
Class[] parameterClasses = {String.class, inputsAndOutputs};
Method invokeCLI =
iasAdminMain.getDeclaredMethod(METHOD_INVOKE_CLI, parameterClasses);
Object[] parameters = {command, null};
if (ACTUALLY_EXEC_COMMAND) {
invokeCLI.invoke(iasAdminMain, parameters);
}
} catch (ClassNotFoundException e) {
String msg = "An iPlanet Application Server 7.0 admin CLI "
+ "class could not be found (" + e.getMessage()
+ "). Use the ias7home attribute, set the "
+ "ias7.home property, or add the appropriate "
+ "JARs to the classpath.";
throw new BuildException(msg, getLocation());
} catch (NoSuchMethodException e) {
String msg = "The \"invokeCLI\" method couldn't be found on the "
+ "IasAdminMain class. The exception message "
+ "is: " + e.getMessage();
throw new BuildException(msg, getLocation());
} catch (InvocationTargetException e) {
String msg = "An exception occurred while running the command. The "
+ "exception message is: "
+ e.getTargetException().getMessage();
throw new BuildException(msg, getLocation());
} catch (IllegalAccessException e) {
String msg = "An exception occurred while trying to invoke the "
+ "\"invokeCLI\" method. The exception message "
+ "is: " + e.getMessage();
throw new BuildException(msg, getLocation());
}
|
public void | execute()
prepareToExecute();
checkConfiguration();
Iterator it = servers.iterator();
while (it.hasNext()) {
Server aServer = (Server)it.next();
execute(aServer);
}
|
protected abstract void | execute(org.apache.tools.ant.taskdefs.optional.iplanet.IasAdmin$Server server)
|
protected java.lang.String[] | getClasspathElements()Returns the JARs and directories that should be added to the classpath
when calling the IasAdminMain class. All elements are relative to the
iPlanet Application Server 7.0 installation directory.
return CLASSPATH_ELEMENTS;
|
protected java.io.File | getIas7home()Returns null if iashome hasn't been explicitly set and the property
ias7.home isn't set.
if (ias7home == null) {
String home = getProject().getProperty("ias7.home");
if (home != null) {
ias7home = new File(home);
}
}
return ias7home;
|
private java.lang.String | getIasClasspath()
StringBuffer classpath = new StringBuffer();
String[] elements = getClasspathElements();
for (int i = 0; i < elements.length; i++ ) {
classpath.append(new File(getIas7home(), elements[i]).getPath());
classpath.append(':");
}
return classpath.toString();
|
private org.apache.tools.ant.taskdefs.optional.iplanet.IasAdmin$Server | getServer()
if (server == null) {
server = new Server();
Iterator it = servers.iterator();
while (it.hasNext()) {
Server aServer = (Server)it.next();
aServer.setParent(server);
}
}
return server;
|
protected void | prepareToExecute()
if ((servers.size() == 0) && (server != null)) {
servers.add(server);
}
|
public void | setHost(java.lang.String host)
getServer().setHost(host);
|
public void | setIas7home(java.io.File iashome)
this.ias7home = ias7home;
|
public void | setInstance(java.lang.String instance)
getServer().setInstance(instance);
|
public void | setInstanceport(int instanceport)
getServer().setInstanceport(instanceport);
|
public void | setPassword(java.lang.String password)
log("setPassword: " + password, Project.MSG_DEBUG);
getServer().setPassword(password);
|
public void | setPort(int port)
getServer().setPort(port);
|
public void | setUser(java.lang.String user)
getServer().setUser(user);
|