com.ibm.websphere.naming

Interface HostnameNormalizer


  1. public interface HostnameNormalizer
Normalize hostname for consistent usage within the WebSphere NameSpace. WebSphere provides a default implementation of this interface which should be satisfactory for most environments. For an environment requiring an alternate normalization routine it is possible to configure your own implementation. See JndiHelper.normalizeHostname(Hashtable env) for details.
See Also:
JndiHelper.normalizeHostname(Hashtable env)

Field Summary

Modifier and Type Field and Description
  1. static
  2. boolean
ESCAPE_DOTS_FALSE
Constant to be used for the EscapeDots parameter of the normalizeHostname methods indicating that no special processing is needed for dots.
  1. static
  2. boolean
ESCAPE_DOTS_TRUE
Constant to be used for the EscapeDots parameter of the normalizeHostname methods indicating that dots need to be escaped.

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
normalizeHostname(boolean escapeDots)
Apply a normalization algorithm to the local hostname.
  1. java.lang.String
normalizeHostname(boolean escapeDots,java.net.InetAddress ipAddress)
Apply a normalization algorithm to the hostname of the host represented by the ipAddress parameter.
  1. java.lang.String
normalizeHostname(boolean escapeDots,java.lang.String hostname)
Apply a normalization algorithm to the hostname parameter.

Field Detail

ESCAPE_DOTS_TRUE

  1. static final boolean ESCAPE_DOTS_TRUE
Constant to be used for the EscapeDots parameter of the normalizeHostname methods indicating that dots need to be escaped. Its value is true.
See Also:

ESCAPE_DOTS_FALSE

  1. static final boolean ESCAPE_DOTS_FALSE
Constant to be used for the EscapeDots parameter of the normalizeHostname methods indicating that no special processing is needed for dots. Its value is false.
See Also:

Method Detail

normalizeHostname

  1. java.lang.String normalizeHostname( boolean escapeDots)
  2. throws javax.naming.NamingException
Apply a normalization algorithm to the local hostname.

Parameters:
escapeDots - boolean indicating whether dots (".") in the hostname should be prepended with the escape character ("\"). Escaping dots is necessary for names that follow INS syntax rules.
  • ESCAPE_DOTS_TRUE - prepend dots with escape character.
  • ESCAPE_DOTS_FALSE - no special handling necessary for dots.
Returns:
String containing the normalized form of the local hostname.
Throws:
javax.naming.NamingException - the explanation of exception should indicate the cause.

normalizeHostname

  1. java.lang.String normalizeHostname( boolean escapeDots,
  2. java.lang.String hostname)
  3. throws javax.naming.NamingException
Apply a normalization algorithm to the hostname parameter.

Parameters:
escapeDots - boolean indicating whether dots (".") in the hostname should be prepended with the escape character ("\"). Escaping dots is necessary for names that follow INS syntax rules.
  • ESCAPE_DOTS_TRUE - prepend dots with escape character
  • ESCAPE_DOTS_FALSE - no special handling necessary for dots
hostname - String containing the hostname to be normalized.
Returns:
String containing the normalized form of the input hostname.
Throws:
javax.naming.NamingException - the explanation of exception should indicate the cause.

normalizeHostname

  1. java.lang.String normalizeHostname( boolean escapeDots,
  2. java.net.InetAddress ipAddress)
  3. throws javax.naming.NamingException
Apply a normalization algorithm to the hostname of the host represented by the ipAddress parameter.

Parameters:
escapeDots - boolean indicating whether dots (".") in the hostname should be prepended with the escape character ("\"). Escaping dots is necessary for names that follow INS syntax rules.
  • ESCAPE_DOTS_TRUE - prepend dots with escape character
  • ESCAPE_DOTS_FALSE - no special handling necessary for dots
ipAddress - java.net.InetAddress representing the hostname to be normalized.
Returns:
String containing the normalized form of the hostname for the host represented by the input ipAddress.
Throws:
javax.naming.NamingException - the explanation of exception should indicate the cause.