use of com.yahoo.dba.perf.myperf.common.DBCredential in project mysql_perf_analyzer by yahoo.
the class MetaDB method retrieveDBCredential.
/**
*
* @param owner
* @param dbGroupName
* @return
*/
public DBCredential retrieveDBCredential(String owner, String dbGroupName) {
Connection conn = null;
try {
if (!this.credCache.containsKey(owner + "||" + dbGroupName)) {
conn = getConnection();
DBCredential cred = retrieveDBCredential(conn, owner, dbGroupName);
if (cred != null)
this.credCache.put(owner + "||" + dbGroupName, cred);
}
DBCredential saved = this.credCache.get(owner + "||" + dbGroupName);
if (//return a decrypted copy
saved != null) {
saved = saved.copy();
saved.decryptPassword(keyTool);
}
return saved;
} catch (Exception ex) {
logger.log(Level.SEVERE, "Exception", ex);
} finally {
DBUtils.close(conn);
}
return null;
}
Aggregations