Class AuthInfo


  • public class AuthInfo
    extends java.lang.Object
    Authentication infomation for a memcached server
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthInfo​(javax.security.auth.callback.CallbackHandler callbackHandler, java.lang.String[] mechanisms)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AuthInfo cramMD5​(java.lang.String username, java.lang.String password)
      Get a typical auth descriptor for CRAM-MD5 auth with the given username and password.
      javax.security.auth.callback.CallbackHandler getCallbackHandler()  
      int getMaxAttempts()  
      java.lang.String[] getMechanisms()  
      void increaseAttempts()  
      boolean isFirstTime()  
      boolean isValid()  
      static AuthInfo plain​(java.lang.String username, java.lang.String password)
      Get a typical auth descriptor for PLAIN auth with the given username and password.
      static AuthInfo typical​(java.lang.String username, java.lang.String password)
      Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given username and password.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • callbackHandler

        private final javax.security.auth.callback.CallbackHandler callbackHandler
      • mechanisms

        private final java.lang.String[] mechanisms
      • maxAttempts

        private final int maxAttempts
      • attempts

        private int attempts
    • Constructor Detail

      • AuthInfo

        public AuthInfo​(javax.security.auth.callback.CallbackHandler callbackHandler,
                        java.lang.String[] mechanisms)
    • Method Detail

      • isValid

        public boolean isValid()
      • isFirstTime

        public boolean isFirstTime()
      • increaseAttempts

        public void increaseAttempts()
      • getMaxAttempts

        public int getMaxAttempts()
      • plain

        public static AuthInfo plain​(java.lang.String username,
                                     java.lang.String password)
        Get a typical auth descriptor for PLAIN auth with the given username and password.
        Parameters:
        u - the username
        p - the password
        Returns:
        an AuthInfo
      • cramMD5

        public static AuthInfo cramMD5​(java.lang.String username,
                                       java.lang.String password)
        Get a typical auth descriptor for CRAM-MD5 auth with the given username and password.
        Parameters:
        u - the username
        p - the password
        Returns:
        an AuthInfo
      • typical

        public static AuthInfo typical​(java.lang.String username,
                                       java.lang.String password)
        Get a typical auth descriptor for CRAM-MD5 or PLAIN auth with the given username and password.
        Parameters:
        u - the username
        p - the password
        Returns:
        an AuthInfo
      • getCallbackHandler

        public javax.security.auth.callback.CallbackHandler getCallbackHandler()
      • getMechanisms

        public java.lang.String[] getMechanisms()