org.rhq.enterprise.communications.util.prefs
Class LocalInetHostnameSetupInstruction

java.lang.Object
  extended by org.rhq.enterprise.communications.util.prefs.SetupInstruction
      extended by org.rhq.enterprise.communications.util.prefs.LocalInetHostnameSetupInstruction

public class LocalInetHostnameSetupInstruction
extends SetupInstruction

This setup instruction is used to define a preference whose value is a fully qualified hostname that is to be bound to the local host, but by default not the loopback device. This is used to allow a user to default the hostname to something other than the loopback device (localhost or 127.0.0.1) in order for clients external to this local box to connect to it.

Author:
John Mazzitelli

Constructor Summary
LocalInetHostnameSetupInstruction(String preference_name, SetupValidityChecker validity_checker, String prompt_message, String help_message)
          Creates a new LocalInetHostnameSetupInstruction object.
LocalInetHostnameSetupInstruction(String preference_name, String prompt_message, String help_message)
          Creates a new LocalInetHostnameSetupInstruction object.
 
Method Summary
 void preProcess()
          Sets the default as a hostname for this local host.
 
Methods inherited from class org.rhq.enterprise.communications.util.prefs.SetupInstruction
getDefaultValue, getHelpMessage, getPreferenceName, getPreferences, getPromptMessage, getValidityChecker, isUsingNoEchoPrompt, postProcess, setDefaultValue, setHelpMessage, setPreferences, setPromptMessage, setUsingNoEchoPrompt, setValidityChecker, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalInetHostnameSetupInstruction

public LocalInetHostnameSetupInstruction(String preference_name,
                                         SetupValidityChecker validity_checker,
                                         String prompt_message,
                                         String help_message)
                                  throws IllegalArgumentException
Creates a new LocalInetHostnameSetupInstruction object. This constructor is to allow an instruction to define a custom hostname whose default is the current preference's value. The default will not be the platform's actual FQDN.

Parameters:
preference_name -
prompt_message -
help_message -
validity_checker -
Throws:
IllegalArgumentException
See Also:
SetupInstruction.SetupInstruction(String, String, SetupValidityChecker, String, String, boolean)

LocalInetHostnameSetupInstruction

public LocalInetHostnameSetupInstruction(String preference_name,
                                         String prompt_message,
                                         String help_message)
                                  throws IllegalArgumentException
Creates a new LocalInetHostnameSetupInstruction object. This adds a validity checker such that if the hostname string that was entered is not a true, DNS resolvable hostname, it fails.

Parameters:
preference_name -
prompt_message -
help_message -
Throws:
IllegalArgumentException
See Also:
SetupInstruction.SetupInstruction(String, String, SetupValidityChecker, String, String, boolean)
Method Detail

preProcess

public void preProcess()
Sets the default as a hostname for this local host. We try not to set it to a loopback device, but if we have no choice, we do. We'll fallback to the current preference value if the default is GET_PREF_DEFAULT_MARKER.

Overrides:
preProcess in class SetupInstruction
See Also:
SetupInstruction.preProcess()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.