commit
47c9f1439d
4 changed files with 5 additions and 4 deletions
|
@ -151,7 +151,7 @@ public class LDAPFederationProvider implements UserFederationProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm) {
|
||||
public List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm, int maxResults) {
|
||||
IdentityManager identityManager = getIdentityManager();
|
||||
List<UserModel> searchResults =new LinkedList<UserModel>();
|
||||
try {
|
||||
|
@ -170,6 +170,7 @@ public class LDAPFederationProvider implements UserFederationProvider {
|
|||
if (attributes.containsKey(LAST_NAME)) {
|
||||
query.setParameter(User.LAST_NAME, attributes.get(LAST_NAME));
|
||||
}
|
||||
query.setLimit(maxResults);
|
||||
List<User> agents = query.getResultList();
|
||||
for (User user : agents) {
|
||||
results.put(user.getLoginName(), user);
|
||||
|
|
|
@ -225,7 +225,7 @@ public class UserFederationManager implements UserProvider {
|
|||
void federationLoad(RealmModel realm, Map<String, String> attributes) {
|
||||
for (UserFederationProviderModel federation : realm.getUserFederationProviders()) {
|
||||
UserFederationProvider fed = getFederationProvider(federation);
|
||||
fed.searchByAttributes(attributes, realm);
|
||||
fed.searchByAttributes(attributes, realm, 30);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public interface UserFederationProvider extends Provider {
|
|||
* @param realm
|
||||
* @return
|
||||
*/
|
||||
List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm);
|
||||
List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm, int maxResults);
|
||||
|
||||
void preRemove(RealmModel realm);
|
||||
void preRemove(RealmModel realm, RoleModel role);
|
||||
|
|
|
@ -47,7 +47,7 @@ public class DummyUserFederationProvider implements UserFederationProvider {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm) {
|
||||
public List<UserModel> searchByAttributes(Map<String, String> attributes, RealmModel realm, int maxResults) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue