void validateHostName(String hostName)
throws CommandValidationException {
if (!StringUtils.ok(hostName)) {
throw new CommandValidationException(
Strings.get("nodehost.required"));
}
try {
// Check if hostName is valid by looking up it's address
InetAddress.getByName(hostName);
}
catch (UnknownHostException e) {
throw new CommandValidationException(
Strings.get("unknown.host", hostName),
e);
}
}