[java-identity-provider COMMIT] in /trunk: idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/reso...

noreply at shibboleth.net noreply at shibboleth.net
Fri Feb 26 12:46:37 EST 2016


Author: scantor
Date: Fri Feb 26 12:46:37 2016
New Revision: 8105

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8105&view=rev
Log:
IDP-931 - Option to bypass data connector caching

https://issues.shibboleth.net/jira/browse/IDP-931

Modified:
    trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java
    trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/AbstractSearchDataConnector.java

Modified: trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java?rev=8105&r1=8104&r2=8105&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java	(original)
+++ trunk/idp-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/context/AttributeResolutionContext.java	Fri Feb 26 12:46:37 2016
@@ -60,15 +60,41 @@
 
     /** How was the principal Authenticated? */
     @Nullable private String principalAuthenticationMethod;
+    
+    /** Whether the resolver should allow for results to come from cache. */
+    private boolean allowCachedResults;
 
     /** Attributes which were resolved and released by the attribute resolver. */
     @Nonnull @NonnullElements private Map<String, IdPAttribute> resolvedAttributes;
     
     /** Constructor. */
     public AttributeResolutionContext() {
+        allowCachedResults = true;
         requestedAttributeNames = Collections.emptySet();
         resolvedAttributes =
                 MapConstraints.constrainedMap(new HashMap<String, IdPAttribute>(), MapConstraints.notNull());
+    }
+    
+    /**
+     * Get whether to allow for results from cache (defaults to true).
+     * 
+     * @return whether to allow for results from cache
+     * 
+     * @since 3.3.0
+     */
+    public boolean getAllowCachedResults() {
+        return allowCachedResults;
+    }
+    
+    /**
+     * Set whether to allow for results from cache.
+     * 
+     * @param flag flag to set
+     * 
+     * @since 3.3.0
+     */
+    public void setAllowCachedResults(final boolean flag) {
+        allowCachedResults = flag;
     }
 
     /**

Modified: trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/AbstractSearchDataConnector.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/AbstractSearchDataConnector.java?rev=8105&r1=8104&r2=8105&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/AbstractSearchDataConnector.java	(original)
+++ trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/AbstractSearchDataConnector.java	Fri Feb 26 12:46:37 2016
@@ -174,7 +174,7 @@
                 PluginDependencySupport.getAllAttributeValues(workContext, getDependencies());
         final T executable = searchBuilder.build(resolutionContext, dependsAttributes);
         Map<String, IdPAttribute> resolvedAttributes = null;
-        if (resultsCache != null) {
+        if (resultsCache != null && resolutionContext.getAllowCachedResults()) {
             final String cacheKey = executable.getResultCacheKey();
             resolvedAttributes = resultsCache.getIfPresent(cacheKey);
             log.trace("{} Cache found, resolved attributes {} using cache {}", new Object[] {getLogPrefix(),



More information about the commits mailing list