Class EngineAccess.DialogHistoryUtilities

  • Enclosing class:
    EngineAccess

    public final class EngineAccess.DialogHistoryUtilities
    extends Object
    This class provides utility methods for modification of the dialog history data.
    Since:
    6.2.0
    • Constructor Detail

      • DialogHistoryUtilities

        public DialogHistoryUtilities()
    • Method Detail

      • replaceMetadata

        public void replaceMetadata​(List<String> _lNames,
                                    String _sReplacement)
        Replaces the values of selected metadata map entries.
        Parameters:
        _lNames - names of the metadata entries to be modified
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.0
      • replaceMetadata

        public void replaceMetadata​(BiFunction<String,​String,​String> _function)
        Applies the given function to all metadata maps. Function result cannot be null.
        Parameters:
        _function - a function accepting two arguments (metadata name and value) producing the new value that must not be {code null}
        Throws:
        IllegalArgumentException - if the passed function parameter is null, or if the function returned null
        Since:
        6.2.0
      • replaceVariables

        public void replaceVariables​(List<String> _lNames,
                                     Object _replacement)
        Replaces the values of selected variables in the changes data of session, flow, annotation variables.
        Parameters:
        _lNames - names of the variables to be modified
        _replacement - the replacement value (may be null)
        Throws:
        IllegalArgumentException - if the passed names parameter is null
        Since:
        6.2.0
      • replaceVariables

        public void replaceVariables​(BiFunction<String,​Object,​Object> _function)
        Applies the given function to all variables in the changes data of session, flow, annotation variables. Function result can be null.
        Parameters:
        _function - a function accepting two arguments (variable name and value) producing the new value (it may be null)
        Throws:
        IllegalArgumentException - if the passed function parameter is null
        Since:
        6.2.0
      • replaceLogVariables

        public void replaceLogVariables​(List<String> _lNames,
                                        String _sReplacement)
        Replaces the values of selected log variables.
        Parameters:
        _lNames - names of the log variables to be modified
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.0
      • replaceLogVariables

        public void replaceLogVariables​(BiFunction<String,​String,​String> _function)
        Applies the given function to all log variables. Function result cannot be null.
        Parameters:
        _function - a function accepting two arguments (log variable name and value) producing the new value that must not be {code null}
        Throws:
        IllegalArgumentException - if the passed function parameter is null, or if the function returned null
        Since:
        6.2.0
      • replaceResponseVariables

        public void replaceResponseVariables​(List<String> _lNames,
                                             String _sReplacement)
        Replaces the values of selected response variables.
        Parameters:
        _lNames - names of the response variables to be modified
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.0
      • replaceResponseVariables

        public void replaceResponseVariables​(BiFunction<String,​String,​String> _function)
        Applies the given function to all response variables. Function result cannot be null.
        Parameters:
        _function - a function accepting two arguments (response variable key and value) producing the new value that must not be {code null}
        Throws:
        IllegalArgumentException - if the passed function parameter is null, or if the function returned null
        Since:
        6.2.0
      • replaceRequestParameters

        public void replaceRequestParameters​(List<String> _lNames,
                                             String[] _sReplacement)
        Replaces the values of selected request parameters.
        Parameters:
        _lNames - names of the request parameters to be modified
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.0
      • replaceRequestParameters

        public void replaceRequestParameters​(BiFunction<String,​String[],​String[]> _function)
        Applies the given function to all request parameters. Function result cannot be null.
        Parameters:
        _function - a function accepting two arguments (request parameter name and value) producing the new value that must not be {code null}
        Throws:
        IllegalArgumentException - if the passed function parameter is null, or if the function returned null
        Since:
        6.2.0
      • replaceResponseURL

        public void replaceResponseURL​(List<String> _lStrings,
                                       String _sReplacement)
        Replaces all matches of the specified strings in all answer/output URLs.
        Parameters:
        _lStrings - the strings to match against
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.0
      • replaceResponseURL

        public void replaceResponseURL​(Function<String,​String> _function)
        Applies the given function to all answer/output URLs. Function result cannot be null.
        Parameters:
        _function - a function accepting one argument (the answer/output URL) producing the new URL that must not be {code null}
        Throws:
        IllegalArgumentException - if the passed function parameter is null, or if the function returned null
        Since:
        6.2.0
      • replaceResponseText

        public void replaceResponseText​(List<String> _lStrings,
                                        String _sReplacement)
        Replaces all matches of the specified strings in all answer/output texts.
        Parameters:
        _lStrings - the strings to match against
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.0
      • replaceResponseText

        public void replaceResponseText​(Function<String,​String> _function)
        Applies the given function to all answer/output texts. Function result cannot be null.
        Parameters:
        _function - a function accepting one argument (the answer/output text) producing the new text that must not be {code null}
        Throws:
        IllegalArgumentException - if the passed function parameter is null, or if the function returned null
        Since:
        6.2.0
      • replaceUserInputText

        public void replaceUserInputText​(List<String> _lStrings,
                                         String _sReplacement)
        Replaces all matches of the specified strings in all user input texts. If the user input text is changed, then input processing and used words data is reset. Note that all "userinput" request parameters are not affected by this replacement.
        Parameters:
        _lStrings - the strings to match against
        _sReplacement - the replacement value
        Throws:
        IllegalArgumentException - if a passed parameter is null
        Since:
        6.2.1
      • replaceUserInputText

        public void replaceUserInputText​(Function<String,​String> _function)
        Applies the given function to all user input texts. If the user input text is changed, then input processing and used words data is reset. Note that all "userinput" request parameters are not affected by this replacement.
        Parameters:
        _function - a function accepting one argument (the user input text) producing the new text that must not be null
        Throws:
        IllegalArgumentException - if the passed function parameter is null or if the function returned null
        Since:
        6.2.1
      • removeMetadata

        public void removeMetadata​(List<String> _lNames)
        Removes selected metadata entries from all metadata maps
        Parameters:
        _lNames - names of the metadata entries to be removed
        Throws:
        IllegalArgumentException - if the passed names parameter is null
        Since:
        6.2.0
      • removeLogVariables

        public void removeLogVariables​(List<String> _lNames)
        Removes selected log variables from all log variables maps.
        Parameters:
        _lNames - names of the log variables to be removed
        Throws:
        IllegalArgumentException - if the passed names parameter is null
        Since:
        6.2.0
      • removeVariables

        public void removeVariables​(List<String> _lNames)
        Removes selected variables from the changes data of session, flow, annotation variables.
        Parameters:
        _lNames - names of the variables to be removed
        Throws:
        IllegalArgumentException - if the passed names parameter is null
        Since:
        6.2.0
      • removeResponseVariables

        public void removeResponseVariables​(List<String> _lNames)
        Removes selected variables from all response variables maps.
        Parameters:
        _lNames - names of the response variables to be removed
        Throws:
        IllegalArgumentException - if the passed names parameter is null
        Since:
        6.2.0
      • removeRequestParameters

        public void removeRequestParameters​(List<String> _lNames)
        Removes selected entries from all request parameter maps.
        Parameters:
        _lNames - the names of the request parameters to be removed
        Throws:
        IllegalArgumentException - if the passed names parameter is null
        Since:
        6.2.0
      • redact

        public void redact​(int _iHistoryIndex,
                           int _iBeginIndex,
                           int _iEndIndex,
                           char _cMask)
        Replaces a specified range of the user input text on a specified history item with a given mask character. Affected used-words are also redacted in all processing path elements. Note that "userinput" request parameter is not affected by redaction.
        Parameters:
        _iHistoryIndex - the index of the history item in the dialog history on where the redaction is applied
        _iBeginIndex - the character index in the user input text where the redaction starts, inclusive
        _iEndIndex - the character index in the user input text where the redaction ends, exclusive
        _cMask - the mask character to be used for redaction
        Throws:
        IllegalArgumentException - if the begin index or the history index is less than 0, or if the end index is less than the begin index, or if the history index is greater than or equal to the dialog history length, or if the end index is greater than the user input length
        Since:
        6.2.0