Class UserDataInteraction

    • 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:
        userInput - User Input
        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:
        option - the user option selected for the interactive input
        state - IStateAccess state
        Returns:
        InteractionResult
        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 - if the silent input cannot be pre-processed
      • 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
      • preProcessUserInput

        public String preProcessUserInput​(String userInput,
                                          IStateAccess state,
                                          boolean isReq)
                                   throws InstallException
        Helper function to pre-process user input
        Parameters:
        userInput - User Input
        state - IStateAccess Object
        isReq - Is required flag @return String Processed input result string
        Throws:
        InstallException - if the user input cannot be pre-processed
      • processValidators

        public CumulativeValResult processValidators​(String procInput,
                                                     IStateAccess state,
                                                     boolean isInter)
                                              throws InstallException
        Validate user input
        Parameters:
        procInput - processed user input
        state - IStateAccess interface
        isInter - is interactive mode
        Returns:
        CumulativeValResult
        Throws:
        InstallException - if validation of the processed input fails
      • 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 - if the default value cannot be resolved
      • 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 - if the default value cannot be read from state
      • 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 - if the value cannot be cleared from state
      • getKey

        public String getKey()
      • isFirst

        public boolean isFirst()
      • isPersistent

        public boolean isPersistent()
      • setIsFirstFlag

        public void setIsFirstFlag​(boolean flag)