Class AbstractUserAuth

    • Field Detail

      • name

        private final java.lang.String name
      • service

        private java.lang.String service
      • cancellable

        private boolean cancellable
    • Constructor Detail

      • AbstractUserAuth

        protected AbstractUserAuth​(java.lang.String name)
    • Method Detail

      • getName

        public final java.lang.String getName()
        Specified by:
        getName in interface NamedResource
        Returns:
        The resource name
      • getService

        public java.lang.String getService()
      • isCancellable

        public boolean isCancellable()
        Description copied from interface: UserAuth
        Tells whether the authentication protocol is cancellable currently.
        Specified by:
        isCancellable in interface UserAuth
        Returns:
        true if the protocol can be canceled at its current state; false if not.
      • setCancellable

        protected void setCancellable​(boolean cancellable)
        Sets whether the authentication protocol is currently cancellable.
        Parameters:
        cancellable - true if the protocol may be canceled in its current state; false if not
      • init

        public void init​(ClientSession session,
                         java.lang.String service)
                  throws java.lang.Exception
        Specified by:
        init in interface UserAuth
        Parameters:
        session - The ClientSession
        service - The requesting service name
        Throws:
        java.lang.Exception - If failed to initialize the mechanism
      • process

        public boolean process​(Buffer buffer)
                        throws java.lang.Exception
        Specified by:
        process in interface UserAuth
        Parameters:
        buffer - The Buffer to process - null if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required
        Returns:
        true if request handled - false if the next authentication mechanism should be used
        Throws:
        java.lang.Exception - If failed to process the request
      • sendAuthDataRequest

        protected abstract boolean sendAuthDataRequest​(ClientSession session,
                                                       java.lang.String service)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • processAuthDataRequest

        protected abstract boolean processAuthDataRequest​(ClientSession session,
                                                          java.lang.String service,
                                                          Buffer buffer)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • destroy

        public void destroy()
        Description copied from interface: UserAuth
        Called to release any allocated resources
        Specified by:
        destroy in interface UserAuth
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object