Class WarmerEntry

java.lang.Object
org.frontcache.warmer.WarmerEntry

public final class WarmerEntry extends Object
One line of a URI list, parsed.
# comments and blank lines are ignored
/
/category/shoes?page=2
http://www.example.com/p/123      # absolute: rebased onto the run's key base
Only the path and query of an entry are used; the key base comes from the run (KeyBase). An absolute entry whose base differs from the run's is rebased, and counted, so a preflight can say how many were. A trailing # comment after whitespace is allowed - it is what the failed-list output writes - while a # with no whitespace before it is a URL fragment, which a browser never sends, and is dropped. An invalid line is skipped and reported, not refused. The deliberate difference from set-config: a config file with a skipped line quietly changes how every request is handled, a URL list with a skipped line fails to warm one URL and the preflight names it.
  • Field Details

    • MAX_LENGTH

      public static final int MAX_LENGTH
      Longest line accepted, matching the engine's default front-cache.max-request-uri-length.
      See Also:
  • Method Details

    • parse

      public static WarmerEntry parse(String line, KeyBase keyBase)
      Parameters:
      line - one line of the list, without its line terminator
      keyBase - the run's key base, used only to decide whether an absolute entry was rebased; may be null (nothing counts as rebased)
    • getKind

      public WarmerEntry.Kind getKind()
    • isEntry

      public boolean isEntry()
    • isInvalid

      public boolean isInvalid()
    • getPathAndQuery

      public String getPathAndQuery()
      The path and query to request - always starts with /. Null unless isEntry().
    • isRebased

      public boolean isRebased()
      True when this was an absolute URL whose base differs from the run's key base.
    • getReason

      public String getReason()
      Why the line is invalid. Null unless isInvalid().