Class InstallInteraction
- java.lang.Object
-
- com.sun.identity.install.tools.configurator.BaseInteraction
-
- com.sun.identity.install.tools.configurator.UserDataInteraction
-
- com.sun.identity.install.tools.configurator.InstallInteraction
-
- All Implemented Interfaces:
InteractionConstants
public class InstallInteraction extends UserDataInteraction implements InteractionConstants
Interaction class to handle user input. This interaction class can handle all user data input related interactions including password interactions. This class extends UserDataInteraction and implements all the necessary hooks to process options and user input in interactive mode.
-
-
Field Summary
-
Fields inherited from interface com.sun.identity.install.tools.configurator.InteractionConstants
LOC_IN_ERR_FAILED_TO_CREATE_INTER, LOC_IN_ERR_INTERACTION_RUN, LOC_IN_ERR_INVALID_USER_INPUT, LOC_IN_ERR_SILENT_INST_FAILED, LOC_IN_MESS_SUMMARY_DESC_FORMAT, LOC_IN_MSG_OPTION_BACK, LOC_IN_MSG_OPTION_CLR_DEF, LOC_IN_MSG_OPTION_EXIT, LOC_IN_MSG_OPTION_HELP, LOC_IN_WRN_INVALID_USER_INPUT, LOC_VA_WRN_VAL_INSTALL_LOG, LOC_VA_WRN_VAL_MESSAGE, STR_IN_COLON, STR_IN_DESCRIPTION_SUFFIX, STR_IN_EMPTY_STRING, STR_IN_ERROR_SUFFIX, STR_IN_HELP_SUFFIX, STR_IN_INSTALL_INTER_TYPE, STR_IN_MSG_OPTION_BACK, STR_IN_MSG_OPTION_CLR_DEF, STR_IN_MSG_OPTION_EXIT, STR_IN_MSG_OPTION_HELP, STR_IN_PROMPT_SUFFIX, STR_IN_SUMMARY_DESCRIPTION_SUFFIX, STR_IN_WARNING_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description InstallInteraction(InteractionInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDefaultValue(IStateAccess state)ArrayListgetDisplayMessages()Method that needs to be implemented by the sub-classes to return the Localized Messages that need to be displayed as part of the interaction.LocalizedMessagegetHelp()LocalizedMessagegetPromptMessage(IStateAccess state)Method that needs to be implemented by the sub-classes to return the prompt message that needs to be displayed for the user to input data.StringgetPromptValue(IStateAccess state)Method that needs to be implemented by the sub-classes to return a prompt value (default value) that needs to be displayed for the user to input data.BaseOptionsgetUserOptions(IStateAccess state)Method that needs to be implemented by the sub-classes to return the ResponseOption's and return the appropriate BaseOptions. * viz., SingleLineOptions & MutliLineOptions.InteractionResultinteract(IStateAccess state)Method that interacts with user in interactive mode.InteractionResultprocessData(String userInput, IStateAccess state)An abstract method to be implemented by child class to process user data for interactive inputInteractionResultprocessOption(UserOptionItem option, IStateAccess state)abstract method to be implemented by child class to process user options for interactive inputvoidsetIsFirstFlag(boolean isFirst)-
Methods inherited from class com.sun.identity.install.tools.configurator.UserDataInteraction
clearValueInState, confirmOnExitStatus, getDefaultValueFinderInfo, getDescription, getError, getInteractionInfo, getKey, getMessage, getNormalizedValue, getPromptSuffix, getSummaryDesc, getSummaryDescription, getWarning, interactSilent, isFirst, isPersistent, preProcessSilentInput, preProcessUserInput, processDefaultValFromAllSources, processDefaultValFromStateOnly, processValidators, setInteractionInfo
-
Methods inherited from class com.sun.identity.install.tools.configurator.BaseInteraction
displayMessages, displayOptionsHelp, displayPromptMessage
-
-
-
-
Constructor Detail
-
InstallInteraction
public InstallInteraction(InteractionInfo info) throws InstallException
- Throws:
InstallException
-
-
Method Detail
-
interact
public InteractionResult interact(IStateAccess state) throws InstallException
Description copied from class:UserDataInteractionMethod that interacts with user in interactive mode. Child class will need to override this method and implement the appropriate hooks processOption and processData- Overrides:
interactin classUserDataInteraction- Parameters:
state- IStateAccess- Returns:
- InteractionResult
- Throws:
InstallException
-
processData
public InteractionResult processData(String userInput, IStateAccess state) throws InstallException
Description copied from class:UserDataInteractionAn abstract method to be implemented by child class to process user data for interactive input- Specified by:
processDatain classUserDataInteractionstate- IStateAccess state- Returns:
- InteractionResult
- Throws:
InstallException
-
processOption
public InteractionResult processOption(UserOptionItem option, IStateAccess state) throws InstallException
Description copied from class:UserDataInteractionabstract method to be implemented by child class to process user options for interactive input- Specified by:
processOptionin classUserDataInteractionstate- IStateAccess state- Returns:
- InteractionResult
- Throws:
InstallException
-
getDisplayMessages
public ArrayList getDisplayMessages()
Description copied from class:BaseInteractionMethod that needs to be implemented by the sub-classes to return the Localized Messages that need to be displayed as part of the interaction.- Specified by:
getDisplayMessagesin classBaseInteraction- Returns:
- ArrayList of LocalizedMessage objects or empty or null ArrayList
-
getHelp
public LocalizedMessage getHelp()
- Overrides:
getHelpin classUserDataInteraction
-
getUserOptions
public BaseOptions getUserOptions(IStateAccess state) throws InstallException
Description copied from class:BaseInteractionMethod that needs to be implemented by the sub-classes to return the ResponseOption's and return the appropriate BaseOptions. * viz., SingleLineOptions & MutliLineOptions.- Specified by:
getUserOptionsin classBaseInteraction- Parameters:
state- IStateAccess- Returns:
- a BaseOptions with ResponseOption's populated.
- Throws:
InstallException- if an error occurred while getting the user options
-
getPromptMessage
public LocalizedMessage getPromptMessage(IStateAccess state)
Description copied from class:BaseInteractionMethod that needs to be implemented by the sub-classes to return the prompt message that needs to be displayed for the user to input data.- Specified by:
getPromptMessagein classBaseInteraction- Parameters:
state- IStateAccess- Returns:
- a LocalizedMessage Prompt
-
getPromptValue
public String getPromptValue(IStateAccess state) throws InstallException
Description copied from class:BaseInteractionMethod that needs to be implemented by the sub-classes to return a prompt value (default value) that needs to be displayed for the user to input data. If the prompt value other than null is returned then the prompt message will be some thing as in Example shown below: Enter the Server Port [8080]:- Specified by:
getPromptValuein classBaseInteraction- Parameters:
state- IStateAccess- Returns:
- a String containing the default value or null if no value is present.
- Throws:
InstallException- TODO
-
setIsFirstFlag
public void setIsFirstFlag(boolean isFirst)
- Overrides:
setIsFirstFlagin classUserDataInteraction
-
getDefaultValue
public String getDefaultValue(IStateAccess state) throws InstallException
- Throws:
InstallException
-
-