validateType();
String passwordFile = getOption(PASSWORDFILE);
String type = getOption(TYPE);
String typeDir = (String) getOperands().get(0);
final Service service = ServiceFactory.getService();
//configure service
service.setDate(new Date().toString());
final StringBuilder ap = new StringBuilder();
service.setName(getName(typeDir, ap));
service.setLocation(ap.toString());
service.setType(type.equals("das") ?
AppserverServiceType.Domain
: AppserverServiceType.NodeAgent);
service.setFQSN();
service.setOSUser();
service.setAsadminPath(SystemPropertyConstants.getAsAdminScriptLocation());
service.setPasswordFilePath(passwordFile);
service.setServiceProperties(getOption(SERVICE_PROPERTIES));
service.isConfigValid();
service.setTrace(CLILogger.isDebug());
service.createService(service.tokensAndValues());
printSuccess(service);
CLILogger.getInstance().printDetailMessage(getLocalizedString(
"CommandSuccessful",
new Object[] {name}));
}