* @param alias the alias to check for
* @param secureAdmin_w SecureAdmin instance (already in a transaction)
*/
private void ensureSecureAdminPrincipalForAlias(final String alias,
final SecureAdmin secureAdmin_w) {
SecureAdminPrincipal p = getSecureAdminPrincipalForAlias(alias, secureAdmin_w);
if (p != null) {
return;
}
try {
/*
* Create a new SecureAdminPrincipal.
*/
final String dn = secureAdminHelper.getDN(alias, true);
p = secureAdmin_w.createChild(SecureAdminPrincipal.class);
p.setDn(dn);
secureAdmin_w.getSecureAdminPrincipal().add(p);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}