Class ComposableDocRouter

java.lang.Object
org.alfresco.solr.tracker.ComposableDocRouter
All Implemented Interfaces:
DocRouter
Direct Known Subclasses:
ExplicitShardIdWithDynamicPropertyRouter, ExplicitShardIdWithStaticPropertyRouter

public abstract class ComposableDocRouter extends Object implements DocRouter
A Composable DocRouter is a document router that can be used standalone or nested in a primary-fallback composite document routing strategy. The main reason why we need this marker supertype is because the return value is different depending on how the document router is used:
  • Standalone or leaf in a primary-fallback chain: the method will return true (node accepted) or false (node not accepted)
  • Primary routing strategy in a composite primary-fallback chain: the method will return true/false if the node is accepted/refused and null if a failure is met. In this way the DocRouterWithFallback can route the request to the fallback strategy.
Author:
agazzarini
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
  • Method Details

    • negativeReturnValue

      protected Boolean negativeReturnValue()
      Properly handles the return value of this doc router. The return value is different depending on how the document router is used:
      • Standalone or leaf in a primary-fallback chain: the method will return true (node accepted) or false (node not accepted)
      • Primary routing strategy in a composite primary-fallback chain: the method will return true/false if the node is accepted/refused and null if a failure is met. In this way the DocRouterWithFallback can route the request to the fallback strategy.
      Returns:
      true/false or true/exception depending on the active mode of this router.
    • debug

      protected void debug(String message, Object... params)