{
try {
String roleName = this.ldapManager.getGroupName(roleId);
if (roleName == null) {
throw new NoSuchRoleException("Role: " + roleId + " was not found in LDAP.");
}
Role role = new Role();
role.setName(roleId);
role.setRoleId(roleId);
role.setSource(this.getSource());
return role;
}
catch (LdapDAOException e) {
throw new NoSuchRoleException("Role: " + roleId + " was not found in LDAP.", e);
}
catch (NoSuchLdapGroupException e) {
throw new NoSuchRoleException("Role: " + roleId + " was not found in LDAP.", e);
}
}