Class GuardRule
java.lang.Object
org.frontcache.guard.GuardRule
A guard rule: name | condition | action.
The name is the rule's identity everywhere else - it is written to the failed-requests log as
the reason and becomes the metric in the Kibana "Frontcache Rejected Requests" dashboard.
Renaming a rule renames the metric.
-
Constructor Summary
ConstructorsConstructorDescriptionGuardRule(String name, List<GuardPredicate> predicates, GuardAction action, boolean dryRun) -
Method Summary
-
Constructor Details
-
GuardRule
-
-
Method Details
-
matches
- Returns:
- true when EVERY predicate holds (predicates are AND-ed, evaluation short-circuits)
-
getName
-
getPredicates
-
getAction
-
isDryRun
public boolean isDryRun() -
getHits
public long getHits() -
countHit
public void countHit() -
getCondition
-
toEntry
- Returns:
- flat, JSON-friendly snapshot of this rule for the management API and the console
-
toString
-