Class PsByFlag

  • All Implemented Interfaces:
    Pass

    public final class PsByFlag
    extends Object
    implements Pass
    Passes by flag.

    The class is immutable and thread-safe.

    Since:
    0.1
    • Constructor Detail

      • PsByFlag

        public PsByFlag​(PsByFlag.Pair... pairs)
        Ctor.
        Parameters:
        pairs - Map entries
        Since:
        0.5.1
      • PsByFlag

        public PsByFlag​(Map<Pattern,​Pass> map)
        Ctor.
        Parameters:
        map - Map
      • PsByFlag

        public PsByFlag​(String flg,
                        PsByFlag.Pair... pairs)
        Ctor.
        Parameters:
        flg - Flag
        pairs - Map entries
        Since:
        0.5.1
      • PsByFlag

        public PsByFlag​(String flg,
                        Map<Pattern,​Pass> map)
        Ctor.
        Parameters:
        flg - Flag
        map - Map
    • 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)
        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