public String loadPassword(String username) {
logger.info("loading password for username {}", username);
String ret = null;
String riverIndexName = getRiverIndexName();
refreshSearchIndex(riverIndexName);
GetResponse resp = client.prepareGet(riverIndexName, riverName().name(), "_pwd").execute().actionGet();
if (resp.isExists()) {
if (logger.isDebugEnabled()) {
logger.debug("Password document: {}", resp.getSourceAsString());
}
Map<String, Object> newset = resp.getSource();
ret = XContentMapValues.nodeStringValue(newset.get("pwd"), null);
}
return ret;
}