Class FkChain

  • All Implemented Interfaces:
    Fork

    public final class FkChain
    extends Object
    implements Fork
    A Fork chain. Routes to each given Fork in order, until one of them returns a response or until none are left.
    Since:
    0.33
    • Constructor Detail

      • FkChain

        public FkChain()
        Ctor.
      • FkChain

        public FkChain​(Fork... forks)
        Ctor.
        Parameters:
        forks - Forks
      • FkChain

        public FkChain​(Collection<Fork> forks)
        Ctor.
        Parameters:
        forks - Forks
    • Method Detail

      • route

        public Opt<Response> route​(Request request)
                            throws Exception
        Description copied from interface: Fork
        Process this request or ignore it.
        Specified by:
        route in interface Fork
        Parameters:
        request - Request
        Returns:
        Non-empty list of responses if it was processed
        Throws:
        Exception - If fails