From 41fec2793dc44931a80a06c66c2a945a0416a042 Mon Sep 17 00:00:00 2001 From: Magnus Lewis-Smith Date: Wed, 23 Oct 2019 12:28:16 +0100 Subject: [PATCH] GUACAMOLE-300: conform to guac-style style guidelines https://guacamole.apache.org/guac-style/ --- .../auth/ldap/conf/ConfigurationService.java | 3 ++- .../auth/ldap/conf/LDAPGuacamoleProperties.java | 3 ++- .../auth/ldap/conf/MemberAttributeType.java | 3 ++- .../ldap/conf/MemberAttributeTypeProperty.java | 9 ++++++--- .../auth/ldap/group/UserGroupService.java | 17 ++++++++++------- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java index 86da90304..47597b982 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java @@ -384,7 +384,8 @@ public class ConfigurationService { * @throws GuacamoleException * If guacamole.properties cannot be parsed. */ - public MemberAttributeType getMemberAttributeType() throws GuacamoleException { + public MemberAttributeType getMemberAttributeType() + throws GuacamoleException { return environment.getProperty( LDAPGuacamoleProperties.LDAP_MEMBER_ATTRIBUTE_TYPE, MemberAttributeType.DN diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java index 7fd6ceff9..f10844a9c 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java @@ -259,7 +259,8 @@ public class LDAPGuacamoleProperties { /** * Specify the type of data contained in 'ldap-member-attribute' */ - public static final MemberAttributeTypeProperty LDAP_MEMBER_ATTRIBUTE_TYPE = new MemberAttributeTypeProperty() { + public static final MemberAttributeTypeProperty LDAP_MEMBER_ATTRIBUTE_TYPE = + new MemberAttributeTypeProperty() { @Override public String getName() { return "ldap-member-attribute-type"; } diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeType.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeType.java index 49418b79f..2fe9cc538 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeType.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeType.java @@ -20,7 +20,8 @@ package org.apache.guacamole.auth.ldap.conf; /** - * All possible means of describing membership within LDAP group directory records. + * All possible means of describing membership within + * LDAP group directory records. */ public enum MemberAttributeType { /** diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeTypeProperty.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeTypeProperty.java index 892441e42..8d9627d9c 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeTypeProperty.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/MemberAttributeTypeProperty.java @@ -28,10 +28,12 @@ import org.apache.guacamole.properties.GuacamoleProperty; * strings "dn" or "uid" are mapped to their values as a MemberAttributeType * enum. Anything else results in a parse error. */ -public abstract class MemberAttributeTypeProperty implements GuacamoleProperty { +public abstract class MemberAttributeTypeProperty + implements GuacamoleProperty { @Override - public MemberAttributeType parseValue(String value) throws GuacamoleException { + public MemberAttributeType parseValue(String value) + throws GuacamoleException { // If no value provided, return null. if (value == null) @@ -46,7 +48,8 @@ public abstract class MemberAttributeTypeProperty implements GuacamoleProperty userAttributes = confService.getUsernameAttributes(); try { - userIDorDN = queryService.getIdentifier(userEntry, userAttributes); + userIDorDN = queryService.getIdentifier(userEntry, + userAttributes); } catch (LdapInvalidAttributeValueException e) { - logger.error("User group missing identifier: {}", e.getMessage()); - logger.debug("LDAP exception while getting group identifier.", e); + logger.error("User group missing identifier: {}", + e.getMessage()); + logger.debug("LDAP exception while getting " + + "group identifier.", e); } } }