public void runCommand()
throws CommandException, CommandValidationException
{
validateOptions();
DeploymentFacility df = DeploymentFacilityFactory.getDeploymentFacility();
ServerConnectionIdentifier conn = createServerConnectionIdentifier(
getHost(), getPort(), getUser(), getPassword());
df.connect(conn);
//prepare data
//Target[] targets = new JESTarget[1];
final String targetName = getOption(TARGET_OPTION);
//targets[0] = new JESTarget(targetName, null);
Map deployOptions = createDeploymentProperties();
JESProgressObject progressObject = null;
try
{
if (df.isConnected())
{
CLILogger.getInstance().printDebugMessage("Calling the undeploy with DeployOptions");
Target[] targets = df.createTargets(new String[]{targetName});
if (targets == null)
{
//CLILogger.getInstance().printError(getLocalizedString("InvalidTarget"));
throw new CommandException(getLocalizedString("InvalidTarget", new Object[] {targetName}));
}
progressObject = df.undeploy(targets, getComponentName(), deployOptions);
} else
{
CLILogger.getInstance().printError(
getLocalizedString("CouldNotConnectToDAS"));
}
}
catch (Exception e)
{
if (e.getLocalizedMessage() != null)
CLILogger.getInstance().printDetailMessage(
e.getLocalizedMessage());
throw new CommandException(getLocalizedString(
"CommandUnSuccessful", new Object[] {name} ), e);
}
DeploymentStatus status = df.waitFor(progressObject);
final String statusString = status.getStageStatusMessage();
if (status != null &&
status.getStatus() == DeploymentStatus.FAILURE) {