* @exception Exception
*/
protected Object doExecute(ServerConnection connection) throws Exception {
DeploymentManager deploymentManager = connection.getDeploymentManager();
Farm farm = (Farm)((GeronimoDeploymentManager)deploymentManager).getImplementation(Farm.class);
Map<String, DownloadResults> results;
if (action == "add") {
if (clusterName != null && pluginList != null && plugin != null) {
results = farm.addPluginToCluster(clusterName, pluginList, plugin);
} else if (clusterName != null && pluginList != null) {
results = farm.addPluginList(clusterName, pluginList);
} else if (pluginList != null && plugin != null) {
results = farm.addPlugin(pluginList, plugin);
} else {
println("add requires -c <cluster> and -l <plugin list name>, -l <plugin list name> and -a <plugin>, or all three");
return null;
}
} else if (action == "remove") {
if (clusterName != null && pluginList != null && plugin != null) {
println("remove requires -c <cluster> and -l <plugin list name>, or -l <plugin list name> and -a <plugin>, but not all three");
return null;
} else if (clusterName != null && pluginList != null) {
results = farm.removePluginListFromCluster(clusterName, pluginList);
} else if (pluginList != null && plugin != null) {
results = farm.removePluginFromPluginList(pluginList, plugin);
} else {
println("remove requires -c <cluster> and -l <plugin list name>, or -l <plugin list> and -a <plugin>");
return null;
}
} else {