You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2017/03/21 17:47:29 UTC
[05/10] incubator-guacamole-client git commit: GUACAMOLE-102: Create
a more global LDAPSearchConstraints in the ConfigurationService.
GUACAMOLE-102: Create a more global LDAPSearchConstraints in the ConfigurationService.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/d1635ce2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/d1635ce2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/d1635ce2
Branch: refs/heads/master
Commit: d1635ce28c52eebd2d99fad1b387dae82f1feb15
Parents: b7fd01e
Author: Nick Couchman <ni...@yahoo.com>
Authored: Sun Mar 19 21:04:32 2017 -0400
Committer: Nick Couchman <ni...@yahoo.com>
Committed: Sun Mar 19 21:04:32 2017 -0400
----------------------------------------------------------------------
.../auth/ldap/ConfigurationService.java | 34 ++++++++++++++++++++
1 file changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/d1635ce2/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
index b5e5555..af67e2b 100644
--- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
+++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ConfigurationService.java
@@ -20,10 +20,13 @@
package org.apache.guacamole.auth.ldap;
import com.google.inject.Inject;
+import com.novell.ldap.LDAPSearchConstraints;
import java.util.Collections;
import java.util.List;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.environment.Environment;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Service for retrieving configuration information regarding the LDAP server.
@@ -31,6 +34,11 @@ import org.apache.guacamole.environment.Environment;
public class ConfigurationService {
/**
+ * Logger for this class.
+ */
+ private final Logger logger = LoggerFactory.getLogger(ConfigurationService.class);
+
+ /**
* The Guacamole server environment.
*/
@Inject
@@ -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;
+
+ }
+
}