Class BotRule
java.lang.Object
org.frontcache.bots.BotRule
One classification rule from conf/bots.conf: name | condition | verdict [| dry-run].
The verdict is a VISITOR TYPE -
bot, guest, or a type the same file declares with
@type <name> like <bot|guest> - and so also a CLIENT TYPE, its root (getClientType(): bot
or guest, nothing else). It is not a judgement
about the client: it selects a behaviour profile (which branch of a WebResponse's expireTimeMap
applies, so a different TTL or a cached response vs. an origin call, and whether an
<fc:include client="..."> fragment is resolved). Guard rules can read it back through
their client-type: predicate, but that is one consumer among several, not the purpose.
Deliberately shaped like GuardRule, hit counter included: an
operator who has read the Guard Rules screen should need no second explanation for this one.-
Constructor Details
-
BotRule
A rule whose verdict is a root,botorguest. -
BotRule
public BotRule(String name, List<GuardPredicate> predicates, String visitorType, String clientType, boolean dryRun) - Parameters:
visitorType- the verdict as written - a root or a declared typeclientType- its root
-
-
Method Details
-
matches
- Returns:
- true when EVERY predicate holds (predicates are AND-ed, evaluation short-circuits)
-
getName
-
getPredicates
-
getClientType
-
getVisitorType
the verdict as written: a root, or a declared type -
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
-