Class FkAnonymous

  • All Implemented Interfaces:
    Fork

    public final class FkAnonymous
    extends Object
    implements Fork
    Fork if no user is logged in now.

    Use this class in combination with TkFork, for example:

     Take take = new TkFork(
       new FkRegex(
         "/",
         new TkFork(
           new FkAnonymous(new TkHome()),
           new FkAuthenticated(new TkAccount())
         )
       )
     );

    The class is immutable and thread-safe.

    Since:
    0.9
    See Also:
    TkFork, TkRegex
    • Constructor Detail

      • FkAnonymous

        public FkAnonymous​(Take tke)
        Ctor.
        Parameters:
        tke - Target
      • FkAnonymous

        public FkAnonymous​(org.cactoos.Scalar<Take> tke)
        Ctor.
        Parameters:
        tke - Target
        Since:
        1.4
    • Method Detail

      • route

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