com.schooner.MemCached.AuthInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Memcached-Java-Client Show documentation
Show all versions of Memcached-Java-Client Show documentation
high performance memcached java client
The newest version!
package com.schooner.MemCached;
import javax.security.auth.callback.CallbackHandler;
/**
* @author Meng Li
* @since 2.6.1
* @see AuthInfo
*/
public class AuthInfo {
private final CallbackHandler callbackHandler;
private final String[] mechanisms;
public AuthInfo(CallbackHandler callbackHandler, String[] mechanisms) {
super();
this.callbackHandler = callbackHandler;
this.mechanisms = mechanisms;
}
public static AuthInfo plain(String username, String password) {
return new AuthInfo(new PlainCallbackHandler(username, password), new String[] { "PLAIN" });
}
public static AuthInfo cramMD5(String username, String password) {
return new AuthInfo(new PlainCallbackHandler(username, password), new String[] { "CRAM-MD5" });
}
public static AuthInfo typical(String username, String password) {
return new AuthInfo(new PlainCallbackHandler(username, password), new String[] { "CRAM-MD5", "PLAIN" });
}
public CallbackHandler getCallbackHandler() {
return callbackHandler;
}
public String[] getMechanisms() {
return mechanisms;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy