Class UserDataInteraction
- java.lang.Object
-
- com.sun.identity.install.tools.configurator.BaseInteraction
-
- com.sun.identity.install.tools.configurator.UserDataInteraction
-
- All Implemented Interfaces:
InteractionConstants
- Direct Known Subclasses:
InstallInteraction
public abstract class UserDataInteraction extends BaseInteraction implements InteractionConstants
Abstract class for user data related interactions in both interactive and silent 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 UserDataInteraction(InteractionInfo info)
Constructor for abstract clas
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clearValueInState(IStateAccess state)
Clear value from state for this interaction since user entered empty inputprotected InteractionResult
confirmOnExitStatus(InteractionResult result, IStateAccess state)
Method to check for exit condition @param result InteractionResult objectDefaultValueFinderInfo
getDefaultValueFinderInfo()
LocalizedMessage
getDescription()
LocalizedMessage
getError()
LocalizedMessage
getHelp()
InteractionInfo
getInteractionInfo()
String
getKey()
LocalizedMessage
getMessage(String suffix)
protected String
getNormalizedValue(String input)
LocalizedMessage
getPromptSuffix()
LocalizedMessage
getSummaryDesc()
LocalizedMessage
getSummaryDescription()
LocalizedMessage
getWarning()
InteractionResult
interact(IStateAccess state)
Method that interacts with user in interactive mode.InteractionResult
interactSilent(IStateAccess state, Map map)
boolean
isFirst()
boolean
isPersistent()
String
preProcessSilentInput(Map userResponseMap)
Function to pre-process user input passed from state file during silent installString
preProcessUserInput(String userInput, IStateAccess state, boolean isReq)
Helper function to pre-process user inputabstract InteractionResult
processData(String userInput, IStateAccess state)
An abstract method to be implemented by child class to process user data for interactive inputString
processDefaultValFromAllSources(IStateAccess state)
Calculate default value for the interaction.String
processDefaultValFromStateOnly(IStateAccess state)
Calculate default value for the interaction from state only.abstract InteractionResult
processOption(UserOptionItem option, IStateAccess state)
abstract method to be implemented by child class to process user options for interactive inputCumulativeValResult
processValidators(String procInput, IStateAccess state, boolean isInter)
Validate user inputvoid
setInteractionInfo(InteractionInfo info)
void
setIsFirstFlag(boolean flag)
-
Methods inherited from class com.sun.identity.install.tools.configurator.BaseInteraction
displayMessages, displayOptionsHelp, displayPromptMessage, getDisplayMessages, getPromptMessage, getPromptValue, getUserOptions
-
-
-
-
Constructor Detail
-
UserDataInteraction
public UserDataInteraction(InteractionInfo info) throws InstallException
Constructor for abstract clas- Parameters:
info
- InteractionInfo- Throws:
InstallException
-
-
Method Detail
-
processData
public abstract InteractionResult processData(String userInput, IStateAccess state) throws InstallException
An abstract method to be implemented by child class to process user data for interactive input- Parameters:
state
- IStateAccess state- Returns:
- InteractionResult
- Throws:
InstallException
-
processOption
public abstract InteractionResult processOption(UserOptionItem option, IStateAccess state) throws InstallException
abstract method to be implemented by child class to process user options for interactive input- Parameters:
state
- IStateAccess state- Returns:
- InteractionResult
- Throws:
InstallException
-
interactSilent
public InteractionResult interactSilent(IStateAccess state, Map map) throws InstallException
- Throws:
InstallException
-
preProcessSilentInput
public String preProcessSilentInput(Map userResponseMap) throws InstallException
Function to pre-process user input passed from state file during silent install- Parameters:
userResponseMap
- Map- Returns:
- String processedInput
- Throws:
InstallException
-
interact
public InteractionResult interact(IStateAccess state) throws InstallException
Method that interacts with user in interactive mode. Child class will need to override this method and implement the appropriate hooks processOption and processData- Parameters:
state
- IStateAccess- Returns:
- InteractionResult
- Throws:
InstallException
-
confirmOnExitStatus
protected InteractionResult confirmOnExitStatus(InteractionResult result, IStateAccess state) throws InstallException
Method to check for exit condition @param result InteractionResult object- Parameters:
state
- IStateAccess- Returns:
- InteractionResult @throws InstallException
- Throws:
InstallException
-
preProcessUserInput
public String preProcessUserInput(String userInput, IStateAccess state, boolean isReq) throws InstallException
Helper function to pre-process user input- Parameters:
userInput
- User Inputstate
- IStateAccess ObjectisReq
- Is required flag @return String Processed input result string- Throws:
InstallException
-
processValidators
public CumulativeValResult processValidators(String procInput, IStateAccess state, boolean isInter) throws InstallException
Validate user input- Parameters:
procInput
- processed user inputstate
- IStateAccess interfaceisInter
- is interactive mode- Returns:
- CumulativeValResult
- Throws:
InstallException
-
processDefaultValFromAllSources
public String processDefaultValFromAllSources(IStateAccess state) throws InstallException
Calculate default value for the interaction. If the default value is null or empty string, it will be returned to the caller for further processing.- Parameters:
state
- IStateAccess interface- Returns:
- String default value for the interaction
- Throws:
InstallException
-
processDefaultValFromStateOnly
public String processDefaultValFromStateOnly(IStateAccess state) throws InstallException
Calculate default value for the interaction from state only. This function will be called for isReq=false- Parameters:
state
- IStateAccess interface- Returns:
- String default value for the interaction
- Throws:
InstallException
-
clearValueInState
public void clearValueInState(IStateAccess state) throws InstallException
Clear value from state for this interaction since user entered empty input- Parameters:
state
- IStateAccess interface @return boolean- Throws:
InstallException
-
getSummaryDescription
public LocalizedMessage getSummaryDescription()
-
getKey
public String getKey()
-
getDefaultValueFinderInfo
public DefaultValueFinderInfo getDefaultValueFinderInfo()
-
getHelp
public LocalizedMessage getHelp()
-
getPromptSuffix
public LocalizedMessage getPromptSuffix()
-
getDescription
public LocalizedMessage getDescription()
-
getSummaryDesc
public LocalizedMessage getSummaryDesc()
-
getError
public LocalizedMessage getError()
-
getWarning
public LocalizedMessage getWarning()
-
getMessage
public LocalizedMessage getMessage(String suffix)
-
isFirst
public boolean isFirst()
-
isPersistent
public boolean isPersistent()
-
setIsFirstFlag
public void setIsFirstFlag(boolean flag)
-
getInteractionInfo
public InteractionInfo getInteractionInfo()
-
setInteractionInfo
public void setInteractionInfo(InteractionInfo info) throws InstallException
- Throws:
InstallException
-
getNormalizedValue
protected String getNormalizedValue(String input) throws InstallException
- Throws:
InstallException
-
-