Class PsChain

  • All Implemented Interfaces:
    Pass

    public final class PsChain
    extends Object
    implements Pass
    Chain of passes.

    The class is immutable and thread-safe.

    Since:
    0.1
    • Constructor Detail

      • PsChain

        public PsChain​(Pass... list)
        Ctor.
        Parameters:
        list - Passes
      • PsChain

        public PsChain​(Iterable<Pass> list)
        Ctor.
        Parameters:
        list - Passes
    • Method Detail

      • enter

        public Opt<Identity> enter​(Request req)
                            throws Exception
        Description copied from interface: Pass
        Authenticate the user by the request.
        Specified by:
        enter in interface Pass
        Parameters:
        req - The request
        Returns:
        Identity of the user found
        Throws:
        Exception - If fails
      • exit

        public Response exit​(Response response,
                             Identity identity)
                      throws Exception
        Description copied from interface: Pass
        Wrap the response with the user.
        Specified by:
        exit in interface Pass
        Parameters:
        response - Response
        identity - Identity
        Returns:
        New response
        Throws:
        Exception - If fails