Package com.sun.identity.common
Enum FqdnValidator
- java.lang.Object
-
- java.lang.Enum<FqdnValidator>
-
- com.sun.identity.common.FqdnValidator
-
- All Implemented Interfaces:
Serializable
,Comparable<FqdnValidator>
public enum FqdnValidator extends Enum<FqdnValidator>
This class determines whether a host name is valid; and allows to retrieve fully qualified host name from a partial (virtual) host name. The list of valid FQDNs are maintained byNamingService.updateFqdnMappings(Set)
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFullyQualifiedHostName(String hostname)
Returns null if a given host name is valid.static FqdnValidator
getInstance()
void
initialize()
boolean
isHostnameValid(String hostname)
Returnstrue
if a host name is valid.static FqdnValidator
valueOf(String name)
Returns the enum constant of this type with the specified name.static FqdnValidator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final FqdnValidator INSTANCE
-
-
Method Detail
-
values
public static FqdnValidator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FqdnValidator c : FqdnValidator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FqdnValidator valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getInstance
public static FqdnValidator getInstance()
-
initialize
public void initialize()
-
isHostnameValid
public boolean isHostnameValid(String hostname)
Returnstrue
if a host name is valid.hostname
is valid if it is contained in the list of fully qualified host names. Or, it is the default host name where OpenAM is installed.- Parameters:
hostname
- host name.- Returns:
- true if a host name is valid.
-
getFullyQualifiedHostName
public String getFullyQualifiedHostName(String hostname)
Returns null if a given host name is valid. Otherwise, this method looks up the fully qualified domain name map for matching entry. Default host name is returned if there is no matching entry.- Parameters:
hostname
- host name.- Returns:
- fully qualified host name of
hostname
.
-
-