[java-identity-provider] 02/03: Make the V2 parser logger static

Rod Widdowson rdw at steadingsoftware.com
Fri Dec 10 10:48:37 UTC 2021


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=3febc9e1411373ef1d90a94b3576458a94c08a3d

commit 3febc9e1411373ef1d90a94b3576458a94c08a3d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Dec 9 20:15:38 2021 +0000

    Make the V2 parser logger static
    
    This allows the factory methods to log appropriately.
---
 .../dc/ldap/impl/LDAPDataConnectorParser.java      | 30 +++++++++++-----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
index 463c4bcb4..7965beb61 100644
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
+++ b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/impl/LDAPDataConnectorParser.java
@@ -217,11 +217,11 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
 
     protected static class V2Parser {
 
+        /** Class logger. */
+        private static final Logger LOG = LoggerFactory.getLogger(V2Parser.class);
+
         /** LDAPDirectory XML element. */
         private final Element configElement;
-
-        /** Class logger. */
-        private final Logger log = LoggerFactory.getLogger(V2Parser.class);
         
         /** LogPrefix of parent. */
         private final String logPrefix;
@@ -305,12 +305,12 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
                     "<SASLConfig>");
                 final Mechanism mechanism = Mechanism.valueOf(authenticationType);
                 if ("ANONYMOUS".equals(authenticationType)) {
-                    log.warn("{} Ignoring unsupported authenticationType {}. " +
+                    LOG.warn("{} Ignoring unsupported authenticationType {}. " +
                             "Do not set bind credentials for anonymous authentication", getLogPrefix(), mechanism);
                 } else if ("STRONG".equals(authenticationType)) {
-                    log.warn("{} Ignoring unsupported authenticationType {}.", getLogPrefix(), mechanism);
+                    LOG.warn("{} Ignoring unsupported authenticationType {}.", getLogPrefix(), mechanism);
                 } else if ("SIMPLE".equals(authenticationType)) {
-                    log.warn("{} Ignoring unsupported authenticationType {}. " +
+                    LOG.warn("{} Ignoring unsupported authenticationType {}. " +
                             "Set bind credentials for simple authentication", getLogPrefix(), mechanism);
                 } else {
                     final BeanDefinitionBuilder saslConfigBuilder =
@@ -375,7 +375,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
                     StringSupport.trimOrNull(AttributeSupport.getAttributeValue(configElement, null, "trustFile"));
             if (trustResource != null) {
                 if (!trustElements.isEmpty()) {
-                    log.warn("{} StartTLSTrustCredential and trustFile= are incompatible.  trustFile used.",
+                    LOG.warn("{} StartTLSTrustCredential and trustFile= are incompatible.  trustFile used.",
                             getLogPrefix());
                 }
                 final BeanDefinitionBuilder credential =
@@ -384,7 +384,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
                 result.addPropertyValue("trustCredential", credential.getBeanDefinition());
             } else if (!trustElements.isEmpty()) {
                 if (trustElements.size() > 1) {
-                    log.warn("{} Too many StartTLSTrustCredential elements in {}; only the first has been consulted",
+                    LOG.warn("{} Too many StartTLSTrustCredential elements in {}; only the first has been consulted",
                             getLogPrefix(), parserContext.getReaderContext().getResource().getDescription());
                 }
                 result.addPropertyValue("trustCredential",
@@ -402,7 +402,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
             if (authKey != null|| authCert != null) {
 
                 if (!authElements.isEmpty()) {
-                    log.warn("{} StartTLSAuthenticationCredential and"
+                    LOG.warn("{} StartTLSAuthenticationCredential and"
                             + " authKey/authCert= are incompatible.  authCert/authKey used.",
                             getLogPrefix());
                 }
@@ -418,7 +418,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
 
             } else if (!authElements.isEmpty()) {
                 if (authElements.size() > 1) {
-                    log.warn("{} Too many StartTLSAuthenticationCredential elements in {};"
+                    LOG.warn("{} Too many StartTLSAuthenticationCredential elements in {};"
                             + " only the first has been consulted", getLogPrefix(), 
                             parserContext.getReaderContext().getResource().getDescription());
                 }
@@ -442,7 +442,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
             final String filter;
             if (!filterElements.isEmpty()) {
                 if (filterElements.size() > 1) {
-                    log.warn("{} only one <FilterTemplate> can be specified; only the first has been consulted",
+                    LOG.warn("{} only one <FilterTemplate> can be specified; only the first has been consulted",
                             getLogPrefix());
                 }
                 filter = StringSupport.trimOrNull(filterElements.get(0).getTextContent().trim());
@@ -540,7 +540,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
             
             if (!returnAttrsElements.isEmpty()) {
                 if (returnAttrsElements.size() > 1) {
-                    log.warn("{} Only one <ReturnAttributes> element can be specified; "+
+                    LOG.warn("{} Only one <ReturnAttributes> element can be specified; "+
                             "only the first has been consulted.", getLogPrefix());
                 }
                 final Element returnAttrsElement = returnAttrsElements.get(0);
@@ -556,7 +556,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
 
             if (!binaryAttrsElements.isEmpty()) {
                 if (binaryAttrsElements.size() > 1) {
-                    log.warn("{} Only one <BinaryAttributes> element can be specified; "+
+                    LOG.warn("{} Only one <BinaryAttributes> element can be specified; "+
                       "only the first has been consulted.", getLogPrefix());
                 }
                 final Element binaryAttrsElement = binaryAttrsElements.get(0);
@@ -582,7 +582,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
                 return null;
             }
             if (poolConfigElements.size() > 1) {
-                log.warn("{} Only one <ConnectionPool> should be specified; only the first has been consulted.",
+                LOG.warn("{} Only one <ConnectionPool> should be specified; only the first has been consulted.",
                         getLogPrefix());
             }
 
@@ -724,7 +724,7 @@ public class LDAPDataConnectorParser extends AbstractDataConnectorParser {
             if (saslConfigElements.isEmpty()) {
                 return null;
             } else if (saslConfigElements.size() > 1) {
-                log.warn("{} Only one <SASLConfig> element can be specified; "+
+                LOG.warn("{} Only one <SASLConfig> element can be specified; "+
                         "only the first has been consulted.", getLogPrefix());
             }
             final Element saslConfigElement = saslConfigElements.get(0);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list