Interface Responder


  • public interface Responder
    Responder defines a pattern of response to some input from a stream.
    A Responder defines up to four different regular expressions:
    • input success pattern: pattern to look for before responding that indicates response should proceed
    • input failure pattern: pattern to look for before responding that indicates failure
    • response success pattern: pattern to look for after responding that indicates success
    • response failure pattern: pattern to look for after responding that indicates failure

    It also defines some other heuristics:
    • inputMaxLines: maximum number of input lines to use to match for input pattern. If exceeded, then "input threshhold" breached.
    • inputMaxTimeout: maximum time to wait while detecting new input. If exceeded, then "input threshhold" breached.
    • failOnInputThreshold: if true, fail if "input threshold" breached, otherwise, ignore it.
    • responseMaxLines: maximum number of input lines to use to match for response pattern. If exceeded, then "response threshhold" breached.
    • responseMaxTimeout: maximum time to wait while detecting response pattern. If exceeded, then "response threshhold" breached.
    • failOnResponseThreshold: if true, fail if "response threshold" breached, otherwise, ignore it.
    • Method Detail

      • getInputSuccessPattern

        java.lang.String getInputSuccessPattern()
        Returns:
        a regex to detect input prompt
      • getInputFailurePattern

        java.lang.String getInputFailurePattern()
        Returns:
        a regex to detect input prompt failure
      • getInputMaxLines

        int getInputMaxLines()
        Returns:
        threshold max lines to read detecting input pattern
      • getInputMaxTimeout

        long getInputMaxTimeout()
        Returns:
        threshold max timeout detecting input pattern
      • isFailOnInputLinesThreshold

        boolean isFailOnInputLinesThreshold()
        Returns:
        true if input max lines threshold indicates failure
      • isFailOnInputTimeoutThreshold

        boolean isFailOnInputTimeoutThreshold()
        Returns:
        true if input max timeout threshold indicates failure
      • getResponseSuccessPattern

        java.lang.String getResponseSuccessPattern()
        Returns:
        a regex to detect response to input was successful
      • getResponseFailurePattern

        java.lang.String getResponseFailurePattern()
        Returns:
        a regex to detect response to input was failure
      • getResponseMaxLines

        int getResponseMaxLines()
        Returns:
        threshold max lines to read detecting response pattern
      • getResponseMaxTimeout

        long getResponseMaxTimeout()
        Returns:
        threshold max timeout detecting response pattern
      • isFailOnResponseThreshold

        boolean isFailOnResponseThreshold()
        Returns:
        true if response threshold indicates failure
      • getInputBytes

        byte[] getInputBytes()
        Returns:
        input string bytes to send after successful input pattern (including any newline characters as necessary)
      • isSuccessOnInputThreshold

        boolean isSuccessOnInputThreshold()
        Returns:
        true if input threshold indicates success