[java-opensaml] branch master updated: Add logging.
Scott Cantor
cantor.2 at osu.edu
Fri May 17 15:01:24 EDT 2019
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=7b910114b9211db2bfecf4a919287336d42dcec5
The following commit(s) were added to refs/heads/master by this push:
new 7b91011 Add logging.
7b91011 is described below
commit 7b910114b9211db2bfecf4a919287336d42dcec5
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri May 17 15:01:22 2019 -0400
Add logging.
---
.../profile/logic/EntityAttributesPredicate.java | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
index 2f861c8..115bf6d 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/profile/logic/EntityAttributesPredicate.java
@@ -194,13 +194,17 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
}
if (entityAttributes == null || entityAttributes.isEmpty()) {
- log.debug("no EntityAttributes extension found for {}", input.getEntityID());
+ log.trace("No Entity Attributes found for {}", input.getEntityID());
return false;
}
+ log.trace("Checking for match against {} Entity Attributes for {}", entityAttributes.size(),
+ input.getEntityID());
+
// If we find a matching tag, we win. Each tag is treated in OR fashion.
final EntityAttributesMatcher matcher = new EntityAttributesMatcher(entityAttributes);
+ // Then we determine whether the overall set of tag containers is AND or OR.
if (matchAll) {
return Iterables.all(candidateSet, matcher::test);
} else {
@@ -330,9 +334,6 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
*/
private class EntityAttributesMatcher implements Predicate<Candidate> {
- /** Class logger. */
- @Nonnull private final Logger log = LoggerFactory.getLogger(EntityAttributesPredicate.class);
-
/** Population to evaluate for a match. */
private final Collection<Attribute> attributes;
@@ -344,7 +345,8 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
public EntityAttributesMatcher(@Nonnull @NonnullElements final Collection<Attribute> attrs) {
attributes = Constraint.isNotNull(attrs, "Extension attributes cannot be null");
}
-
+
+// Checkstyle: MethodLength OFF
/** {@inheritDoc} */
public boolean test(@Nonnull final Candidate input) {
final List<String> tagvals = input.values;
@@ -369,10 +371,14 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
final String cvalstr = xmlObjectToString(cval);
if (tagvalstr != null && cvalstr != null) {
if (tagvalstr.equals(cvalstr)) {
+ log.trace("Matched Entity Attribute ({}:{}) value {}", a.getNameFormat(),
+ a.getName(), tagvalstr);
valflags[tagindex] = true;
break;
} else if (trimTags) {
if (tagvalstr.equals(cvalstr.trim())) {
+ log.trace("Matched Entity Attribute ({}:{}) value {}", a.getNameFormat(),
+ a.getName(), tagvalstr);
valflags[tagindex] = true;
break;
}
@@ -389,6 +395,8 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
final String cvalstr = xmlObjectToString(cval);
if (tagexps.get(tagindex) != null && cvalstr != null) {
if (tagexps.get(tagindex).matcher(cvalstr).matches()) {
+ log.trace("Matched Entity Attribute ({}:{}) value {}", a.getNameFormat(),
+ a.getName(), cvalstr);
expflags[tagindex] = true;
break;
}
@@ -412,6 +420,7 @@ public class EntityAttributesPredicate implements Predicate<EntityDescriptor> {
return true;
}
+// Checkstyle: MethodLength ON
/**
* Convert an XMLObject to a String if the type of recognized.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list