[java-identity-provider COMMIT] in /trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou: IsTermsOfUse...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Oct 17 23:59:54 EDT 2014
Author: tzeller
Date: Fri Oct 17 23:59:54 2014
New Revision: 6736
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6736&view=rev
Log:
Consent cleanup. One function to lookup interceptor flow descriptor types.
Modified:
trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/IsTermsOfUseConsentRequiredPredicate.java
trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/TermsOfUseConsentFunction.java
Modified: trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/IsTermsOfUseConsentRequiredPredicate.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/IsTermsOfUseConsentRequiredPredicate.java?rev=6736&r1=6735&r2=6736&view=diff
==============================================================================
--- trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/IsTermsOfUseConsentRequiredPredicate.java (original)
+++ trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/IsTermsOfUseConsentRequiredPredicate.java Fri Oct 17 23:59:54 2014
@@ -26,7 +26,7 @@
import net.shibboleth.idp.consent.Consent;
import net.shibboleth.idp.consent.context.ConsentContext;
import net.shibboleth.idp.consent.flow.ConsentFlowDescriptor;
-import net.shibboleth.idp.consent.logic.FlowDescriptorLookupStrategy;
+import net.shibboleth.idp.consent.logic.FlowDescriptorLookup;
import net.shibboleth.utilities.java.support.logic.Constraint;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
@@ -52,20 +52,11 @@
/** Consent flow descriptor lookup strategy. */
@Nonnull private Function<ProfileRequestContext, ConsentFlowDescriptor> consentFlowDescriptorLookupStrategy;
- /** Function that returns a consent object representing consent to a terms of use. */
- @Nonnull private Function<ProfileRequestContext, Map<String, Consent>> termsOfUseConsentFunction;
-
- /**
- * Constructor.
- *
- * @param consentFunction function that returns a consent object representing consent to a terms of use
- */
- public IsTermsOfUseConsentRequiredPredicate(
- @Nonnull final Function<ProfileRequestContext, Map<String, Consent>> consentFunction) {
+ /** Constructor. */
+ public IsTermsOfUseConsentRequiredPredicate() {
consentContextLookupStrategy = new ChildContextLookup<>(ConsentContext.class);
- consentFlowDescriptorLookupStrategy = new FlowDescriptorLookupStrategy<ConsentFlowDescriptor>();
- termsOfUseConsentFunction =
- Constraint.isNotNull(consentFunction, "Terms of use consent function cannot be null");
+ consentFlowDescriptorLookupStrategy =
+ new FlowDescriptorLookup<ConsentFlowDescriptor>(ConsentFlowDescriptor.class);
}
/**
Modified: trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/TermsOfUseConsentFunction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/TermsOfUseConsentFunction.java?rev=6736&r1=6735&r2=6736&view=diff
==============================================================================
--- trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/TermsOfUseConsentFunction.java (original)
+++ trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/tou/TermsOfUseConsentFunction.java Fri Oct 17 23:59:54 2014
@@ -26,7 +26,7 @@
import net.shibboleth.idp.consent.Consent;
import net.shibboleth.idp.consent.flow.ConsentFlowDescriptor;
-import net.shibboleth.idp.consent.logic.FlowDescriptorLookupStrategy;
+import net.shibboleth.idp.consent.logic.FlowDescriptorLookup;
import net.shibboleth.idp.consent.logic.HashFunction;
import net.shibboleth.idp.consent.logic.LocaleLookupStrategy;
@@ -65,7 +65,8 @@
/** Constructor. */
public TermsOfUseConsentFunction() {
- consentFlowDescriptorLookupStrategy = new FlowDescriptorLookupStrategy<ConsentFlowDescriptor>();
+ consentFlowDescriptorLookupStrategy =
+ new FlowDescriptorLookup<ConsentFlowDescriptor>(ConsentFlowDescriptor.class);
hashFunction = new HashFunction();
localeLookupStrategy = new LocaleLookupStrategy();
}
@@ -136,7 +137,7 @@
if (consentFlowDescriptor != null) {
return consentFlowDescriptor.compareValues();
}
-
+
return false;
}
@@ -146,14 +147,14 @@
if (input == null) {
return null;
}
-
+
final Consent consent = new Consent();
consent.setId(getConsentId(input));
-
+
if (isCompareValues(input)) {
consent.setValue(getConsentValue(input));
}
-
+
return Collections.singletonMap(consent.getId(), consent);
}
}
More information about the commits
mailing list