Class GuardOutcome

java.lang.Object
org.frontcache.guard.GuardOutcome

public class GuardOutcome extends Object
Result of running the guard pipeline for one request: either "carry on to FC_Total" or a terminal action (reject / redirect) together with the rule that produced it. Dry-run rules that matched are carried alongside: they do not stop the request, but each one is written to the failed-requests log so a new rule can be validated against real traffic before it enforces anything.
  • Field Details

    • CONTINUE

      public static final GuardOutcome CONTINUE
      no rule matched - the request continues as usual
  • Method Details

    • terminal

      public static GuardOutcome terminal(GuardRule rule, String resolvedTarget, List<GuardRule> dryRunMatches)
    • terminal

      public static GuardOutcome terminal(GuardRule rule, GuardAction action, String resolvedTarget, List<GuardRule> dryRunMatches)
      Parameters:
      action - what is done instead of the rule's own action - a challenge rule's else, or the 429 a challenge answers a request it cannot redirect
    • challenge

      public static GuardOutcome challenge(GuardRule rule, String target, String challengePlugin, List<GuardRule> dryRunMatches)
      A challenge: a redirect to challengePlugin's page, at target.
    • cont

      public static GuardOutcome cont(List<GuardRule> dryRunMatches)
    • isTerminal

      public boolean isTerminal()
    • getRule

      public GuardRule getRule()
    • getAction

      public GuardAction getAction()
      Returns:
      what is done - the rule's action, except where a challenge rule fell back to its else action or answered a non-GET with a 429; null for CONTINUE
    • getChallengePlugin

      public String getChallengePlugin()
      Returns:
      the plugin a challenge sends the visitor to; null for every other outcome
    • getResolvedTarget

      public String getResolvedTarget()
      Returns:
      redirect target with placeholders expanded, or null for non-redirect outcomes
    • getDryRunMatches

      public List<GuardRule> getDryRunMatches()