Class ComposableDocRouter

  • All Implemented Interfaces:
    DocRouter
    Direct Known Subclasses:
    ExplicitShardIdWithDynamicPropertyRouter, ExplicitShardIdWithStaticPropertyRouter

    public abstract class ComposableDocRouter
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected org.slf4j.Logger logger  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void debug​(java.lang.String message, java.lang.Object... params)  
      protected java.lang.Boolean negativeReturnValue()
      Properly handles the return value of this doc router.
      • Methods inherited from class java.lang.Object

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

      • logger

        protected final org.slf4j.Logger logger
    • Method Detail

      • negativeReturnValue

        protected java.lang.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​(java.lang.String message,
                             java.lang.Object... params)