Class ExtPredicate

java.lang.Object
org.frontcache.guard.ExtPredicate
All Implemented Interfaces:
GuardPredicate

public final class ExtPredicate extends Object implements GuardPredicate
ext:<name>[:<argument>] - a condition a started plugin offers (decide, E3). Parsed here into its name and argument only: the rules load before the plugins start, and the console and the portal check files with no plugin at all. The plugin compiles the argument when the predicate is first bound after the plugins (re)start - see PluginPredicates.

When it has no answer - no started plugin offers the name, the plugin refused the argument, threw, or is switched off for going over its budget - test(RequestContext) throws PredicateUndecided and the rule does not match.

  • Field Details

  • Method Details

    • getName

      public String getName()
    • getArgument

      public String getArgument()
    • test

      public boolean test(RequestContext context)
      Specified by:
      test in interface GuardPredicate
      Parameters:
      context - request context - may carry a null servlet request (async include, or a synthetic probe context used for startup loop detection)
      Returns:
      true when this condition holds for the request
    • pluginPredicate

      public ExtPredicate pluginPredicate()
      Description copied from interface: GuardPredicate
      The plugin's predicate this one is, or negates; null for a core predicate.
      Specified by:
      pluginPredicate in interface GuardPredicate
    • describe

      public String describe()
      Specified by:
      describe in interface GuardPredicate
      Returns:
      the predicate as written in guard-rules.conf (used by logs and the admin API)
    • binding

      public Object binding()
    • binding

      public void binding(Object binding)