Class ClientSelector

java.lang.Object
org.frontcache.bots.ClientSelector

public final class ClientSelector extends Object
The client="..." attribute of an <fc:include>: which visitors the fragment is resolved for.
  • a name selects by is-a - client="guest" is every guest and every type like guest, so a page written before declared types existed keeps its audience;
  • a comma list selects any of its names - client="customer, captcha-passed";
  • !name excludes - client="!customer" is everyone who is not a customer, bots included, and client="guest, !customer" guests who are not. Resolved when the request is-a some positive name (or there is none) and is-a no negated one.
A name this node does not know is WARNed (once per value) and dropped, and a list left with no name means "no attribute" - resolved for everyone - which is what any value but bot / guest meant before: a typo fails the way it always failed. all, the documented spelling of the default, is everyone without a warning.
  • Field Details

  • Method Details

    • parse

      public static ClientSelector parse(String value, VisitorTypes types)
      Parameters:
      value - the attribute's value, or null
      types - the node's vocabulary
      Returns:
      the selector, or null for "resolve for everyone" - no attribute, or no name this node knows
    • selects

      public boolean selects(String visitorType, String clientType)
      Returns:
      true when the fragment is resolved for a request of this visitor type (leaf) and client type (root)
    • toString

      public String toString()
      Overrides:
      toString in class Object