com.opsbears.webcomponents.net.InvalidDomainNameException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of net Show documentation
Show all versions of net Show documentation
Basic abstraction of network-relevant objects.
package com.opsbears.webcomponents.net;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import java.security.InvalidParameterException;
/**
* This error indicates that a formally invalid domain name was encountered while instantiating a DomainName class. It
* usually indicates that a domain name entered by an end user was invalid, or the reverse DNS of an IP address does not
* contain a valid value.
*
* It does not, however, indicate that the domain does not exist.
*
* ## Solution:
*
* - If the domain name was entered by the user, catch this error and display a useful error message.
* - If the domain name comes from a programmatic source, catch this error and deliver an error code. Optionally,
* disregard the domain name.
* - If the domain name comes from a configuration or your own code, trace it back to the source and fix it there.
*/
@ParametersAreNonnullByDefault
@Immutable
public class InvalidDomainNameException extends InvalidParameterException {
private String domainName;
public InvalidDomainNameException(String domainName) {
super("Invalid domain name: " + domainName);
this.domainName = domainName;
}
public String getDomainName() {
return domainName;
}
}