mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-102: Create a more global LDAPSearchConstraints in the ConfigurationService.
This commit is contained in:
@@ -20,16 +20,24 @@
|
|||||||
package org.apache.guacamole.auth.ldap;
|
package org.apache.guacamole.auth.ldap;
|
||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import com.novell.ldap.LDAPSearchConstraints;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.environment.Environment;
|
import org.apache.guacamole.environment.Environment;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service for retrieving configuration information regarding the LDAP server.
|
* Service for retrieving configuration information regarding the LDAP server.
|
||||||
*/
|
*/
|
||||||
public class ConfigurationService {
|
public class ConfigurationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logger for this class.
|
||||||
|
*/
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(ConfigurationService.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Guacamole server environment.
|
* The Guacamole server environment.
|
||||||
*/
|
*/
|
||||||
@@ -264,4 +272,30 @@ public class ConfigurationService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a set of LDAPSearchConstraints to apply globally
|
||||||
|
* to all LDAP searches rather than having various instances
|
||||||
|
* dispersed throughout the code. Currently contains the
|
||||||
|
* maximum number of LDAP results to return in a search, as
|
||||||
|
* well as whether or not aliases should be dereferenced
|
||||||
|
* during LDAP operations.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* A LDAPSearchConstraints object containing constraints
|
||||||
|
* to be applied to all LDAP search operations.
|
||||||
|
*
|
||||||
|
* @throws GuacamoleException
|
||||||
|
* If guacamole.properties cannot be parsed.
|
||||||
|
*/
|
||||||
|
public LDAPSearchConstraints getLDAPSearchConstraints() throws GuacamoleException {
|
||||||
|
|
||||||
|
LDAPSearchConstraints constraints = new LDAPSearchConstraints();
|
||||||
|
|
||||||
|
constraints.setMaxResults(getMaxResults());
|
||||||
|
constraints.setDereference(getDereferenceAliases());
|
||||||
|
|
||||||
|
return constraints;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user