putting a check for domain name list

This commit is contained in:
Abhinandan Prateek 2011-08-02 15:22:49 +05:30
parent 46be774ce8
commit 70b9769bd5
1 changed files with 7 additions and 0 deletions

View File

@ -1187,6 +1187,13 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
// add the domain prefix list to details if not null
if (domainSuffixList != null){
for(String dom : domainSuffixList){
if (!NetUtils.verifyDomainName(dom)) {
throw new InvalidParameterValueException(
"Invalid network domain suffixes. Total length shouldn't exceed 190 chars. Each domain label must be between 1 and 63 characters long, can contain ASCII letters 'a' through 'z', the digits '0' through '9', "
+ "and the hyphen ('-'); can't start or end with \"-\"");
}
}
newDetails.put("dns.suffixes", StringUtils.join(domainSuffixList, ","));
}