From f2b4053192c9ccd236e33361bf55456836d22ac7 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Mon, 20 Mar 2017 20:24:46 -0400 Subject: [PATCH] GUACAMOLE-244: Rename DereferenceAliases class to DereferenceAliasesMode, fix several comment issues and spelling mistakes. --- .../auth/ldap/ConfigurationService.java | 14 ++++------- ...iases.java => DereferenceAliasesMode.java} | 25 +++++++++++-------- .../auth/ldap/DereferenceAliasesProperty.java | 12 ++++----- .../auth/ldap/LDAPGuacamoleProperties.java | 3 ++- 4 files changed, 27 insertions(+), 27 deletions(-) rename extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/{DereferenceAliases.java => DereferenceAliasesMode.java} (72%) 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 c33e3204f..3d9ea64bf 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 @@ -224,7 +224,7 @@ public class ConfigurationService { * @throws GuacamoleException * If guacamole.properties cannot be parsed. */ - public int getMaxResults() throws GuacamoleException { + private int getMaxResults() throws GuacamoleException { return environment.getProperty( LDAPGuacamoleProperties.LDAP_MAX_SEARCH_RESULTS, 1000 @@ -234,7 +234,7 @@ public class ConfigurationService { /** * Returns whether or not LDAP aliases will be dereferenced, * as configured with guacamole.properties. The default - * behavior if not explicityly defined is to never + * behavior if not explicitly defined is to never * dereference them. * * @return @@ -244,21 +244,17 @@ public class ConfigurationService { * @throws GuacamoleException * If guacamole.properties cannot be parsed. */ - public DereferenceAliases getDereferenceAliases() throws GuacamoleException { + private DereferenceAliasesMode getDereferenceAliases() throws GuacamoleException { return environment.getProperty( LDAPGuacamoleProperties.LDAP_DEREFERENCE_ALIASES, - DereferenceAliases.NEVER + DereferenceAliasesMode.NEVER ); } /** * 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. + * to all LDAP searches. * * @return * A LDAPSearchConstraints object containing constraints diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliases.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesMode.java similarity index 72% rename from extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliases.java rename to extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesMode.java index 5c339d6f8..406c2478c 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliases.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesMode.java @@ -19,41 +19,44 @@ package org.apache.guacamole.auth.ldap; +import com.novell.ldap.LDAPSearchConstraints; + /** - * Acceptable values for configuring the dereferencing of aliases in - * talking to LDAP servers. + * Data type that handles acceptable values for configuring + * alias dereferencing behavior when querying LDAP servers. */ -public enum DereferenceAliases { +public enum DereferenceAliasesMode { /** * Never dereference aliases. This is the default. */ - NEVER(0), + NEVER(LDAPSearchConstraints.DEREF_NEVER), /** * Aliases are dereferenced below the base object, but not to locate * the base object itself. So, if the base object is itself an alias * the search will not complete. */ - SEARCHING(1), + SEARCHING(LDAPSearchConstraints.DEREF_SEARCHING), /** * Aliases are only dereferenced to locate the base object, but not * after that. So, a search against a base object that is an alias will - * find any subordinates of the real object the aliase references, but + * find any subordinates of the real object the alias references, but * further aliases in the search will not be dereferenced. */ - FINDING(2), + FINDING(LDAPSearchConstraints.DEREF_FINDING), /** * Aliases will always be dereferenced, both to locate the base object * and when handling results returned by the search. */ - ALWAYS(3); + ALWAYS(LDAPSearchConstraints.DEREF_ALWAYS); /** - * The integer value that the enum represents, which is used in - * configuring the JLDAP library. + * The integer constant as defined in the JLDAP library that + * the LDAPSearchConstraints class uses to define the + * dereferencing behavior during search operations. */ public final int DEREF_VALUE; @@ -64,7 +67,7 @@ public enum DereferenceAliases { * @param derefValue * The value associated with this dereference setting */ - private DereferenceAliases(int derefValue) { + private DereferenceAliasesMode(int derefValue) { this.DEREF_VALUE = derefValue; } diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesProperty.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesProperty.java index 61a8944ca..7888347b1 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesProperty.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/DereferenceAliasesProperty.java @@ -28,10 +28,10 @@ import org.apache.guacamole.properties.GuacamoleProperty; * "never", "searching", "finding", and "always" are mapped to their values as a * DereferenceAliases enum. Anything else results in a parse error. */ -public abstract class DereferenceAliasesProperty implements GuacamoleProperty { +public abstract class DereferenceAliasesProperty implements GuacamoleProperty { @Override - public DereferenceAliases parseValue(String value) throws GuacamoleException { + public DereferenceAliasesMode parseValue(String value) throws GuacamoleException { // No value provided, so return null. if (value == null) @@ -39,19 +39,19 @@ public abstract class DereferenceAliasesProperty implements GuacamoleProperty