Class DuplicateHostHelper

java.lang.Object
org.codelibs.fess.helper.DuplicateHostHelper

public class DuplicateHostHelper extends Object
Helper class for managing duplicate host configurations in the Fess search system. This class handles URL conversion based on duplicate host rules, allowing multiple hostnames or URLs to be treated as equivalent for crawling and indexing purposes. It maintains a list of DuplicateHost rules and applies them to URLs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost>
    List of duplicate host rules for URL conversion
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for DuplicateHostHelper.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.codelibs.fess.opensearch.config.exentity.DuplicateHost duplicateHost)
    Adds a new duplicate host rule to the list.
    Converts a URL using all configured duplicate host rules.
    void
    Initializes the duplicate host helper after construction.
    void
    setDuplicateHostList(List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost> duplicateHostList)
    Sets the list of duplicate host rules.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • duplicateHostList

      protected List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost> duplicateHostList
      List of duplicate host rules for URL conversion
  • Constructor Details

    • DuplicateHostHelper

      public DuplicateHostHelper()
      Default constructor for DuplicateHostHelper. Creates a new duplicate host helper instance.
  • Method Details

    • init

      @PostConstruct public void init()
      Initializes the duplicate host helper after construction. Loads duplicate host configurations from the DuplicateHostService.
    • setDuplicateHostList

      public void setDuplicateHostList(List<org.codelibs.fess.opensearch.config.exentity.DuplicateHost> duplicateHostList)
      Sets the list of duplicate host rules.
      Parameters:
      duplicateHostList - the list of duplicate host rules to use
    • add

      public void add(org.codelibs.fess.opensearch.config.exentity.DuplicateHost duplicateHost)
      Adds a new duplicate host rule to the list. Initializes the list if it doesn't exist.
      Parameters:
      duplicateHost - the duplicate host rule to add
    • convert

      public String convert(String url)
      Converts a URL using all configured duplicate host rules. Applies each duplicate host rule in sequence to transform the URL according to the configured patterns.
      Parameters:
      url - the URL to convert
      Returns:
      the converted URL after applying all duplicate host rules, or null if the input URL is null