GUACAMOLE-300: conform to guac-style style guidelines

https://guacamole.apache.org/guac-style/
This commit is contained in:
Magnus Lewis-Smith
2019-10-23 12:28:16 +01:00
parent 450af91be9
commit 41fec2793d
5 changed files with 22 additions and 13 deletions

View File

@@ -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

View File

@@ -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"; }

View File

@@ -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 {
/**

View File

@@ -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<MemberAttributeType> {
public abstract class MemberAttributeTypeProperty
implements GuacamoleProperty<MemberAttributeType> {
@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<M
return MemberAttributeType.UID;
// The provided value is not legal
throw new GuacamoleServerException("Member attribute type must be one of \"dn\" or \"uid\".");
throw new GuacamoleServerException("Member attribute type must be "
+ "one of \"dn\" or \"uid\".");
}

View File

@@ -188,19 +188,22 @@ public class UserGroupService {
confService.getUserSearchFilter(),
0);
// ... there can surely only be one
if (userEntries.size() != 1) {
logger.warn("user DN \"{}\" does not return unique value and will be ignored",
userDN.toString());
} else {
if (userEntries.size() != 1)
logger.warn("user DN \"{}\" does not return unique value "
+ "and will be ignored", userDN.toString());
else {
// determine unique identifier for user
Entry userEntry = userEntries.get(0);
Collection<String> 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);
}
}
}