All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opsbears.webcomponents.net.InvalidDomainNameException Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha14
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy