blob: d0681d11ddbc71b230c319a5e156ffc4dd9342ea [file] [log] [blame]
package backtype.storm.utils;
import backtype.storm.Config;
import java.io.UnsupportedEncodingException;
import java.util.Map;
public class ZookeeperAuthInfo {
public String scheme;
public byte[] payload = null;
public ZookeeperAuthInfo(Map conf) {
String scheme = (String) conf.get(Config.STORM_ZOOKEEPER_AUTH_SCHEME);
String payload = (String) conf.get(Config.STORM_ZOOKEEPER_AUTH_PAYLOAD);
if(scheme!=null) {
this.scheme = scheme;
if(payload != null) {
try {
this.payload = payload.getBytes("UTF-8");
} catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex);
}
}
}
}
public ZookeeperAuthInfo(String scheme, byte[] payload) {
this.scheme = scheme;
this.payload = payload;
}
}