try
{
RedbackRuntimeConfiguration redbackRuntimeConfiguration =
redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration();
LdapGroupMapping ldapGroupMapping = new LdapGroupMapping( ldapGroup );
int idx = redbackRuntimeConfiguration.getLdapGroupMappings().indexOf( ldapGroupMapping );
if ( idx > -1 )
{
logger.debug( "updateLdapMapping ldapGroup: {}, roles: {}", ldapGroup, roles );
ldapGroupMapping = redbackRuntimeConfiguration.getLdapGroupMappings().get( idx );
ldapGroupMapping.setRoleNames( roles );
}
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
}
catch ( RepositoryAdminException e )