Class AuthDescriptor

java.lang.Object
net.spy.memcached.auth.AuthDescriptor

public class AuthDescriptor extends Object
Information required to specify authentication mechanisms and callbacks.
  • Constructor Details

    • AuthDescriptor

      public AuthDescriptor(String[] m, CallbackHandler h, String s, Map<String,?> p, Provider[] sp)
      Request authentication using the given list of mechanisms and callback handler.

      If the list of mechanisms is empty, then the client will try to fetch a list of supported SASL mechanisms from the server. If this is not supported by the server or a specific method needs to be forced, passing a specific list of mechanisms in will work.

      For example, if the server would support CRAM-MD5 and PLAIN, the most secure variant (CRAM-MD5) will be chosen by default. If PLAIN should be used instead, passing in new String[] {"PLAIN"} will force the client to use PLAIN.

      It is possible to specify an optional server name to be used in certain digest mechanisms for validation. If unspecified, the server's socket address is used.

      Parameters:
      m - list of mechanisms
      h - the callback handler for grabbing credentials and stuff
      s - the server name. Can be null
      p - a Map of implementation-specific
    • AuthDescriptor

      public AuthDescriptor(String[] m, CallbackHandler h, String s, Map<String,?> p)
    • AuthDescriptor

      public AuthDescriptor(String[] m, CallbackHandler h)
      Parameters:
      m - list of mechanisms
      h - the callback handler for grabbing credentials and stuff
  • Method Details

    • typical

      public static AuthDescriptor typical(String u, String p)
      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 AuthDescriptor
    • authThresholdReached

      public boolean authThresholdReached()
    • getMechs

      public String[] getMechs()
    • getCallback

      public CallbackHandler getCallback()
    • getProperties

      public Map<String,?> getProperties()
    • getServerName

      public String getServerName()
    • getProviders

      public Provider[] getProviders()