[java-opensaml COMMIT] in /trunk/opensaml-storage-impl/src: main/java/org/opensaml/storage/impl/client/ClientStorageS...
noreply at shibboleth.net
noreply at shibboleth.net
Sun Aug 23 19:40:56 EDT 2015
Author: scantor
Date: Sun Aug 23 19:40:56 2015
New Revision: 4327
URL: http://svn.shibboleth.net/view/java-opensaml?rev=4327&view=rev
Log:
IDP-594 - Client storage save actions and tests
Added:
trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/LogLocalStorageSaveResults.java (with props)
trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/SaveCookieBackedClientStorageServices.java (with props)
trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/AbstractBaseClientStorageServiceTest.java (with props)
trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/SaveCookieBackedClientStorageServicesTest.java (with props)
Modified:
trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/LoadClientStorageServices.java
trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/LoadClientStorageServicesTest.java
trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContextTest.java
trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/PopulateClientStorageSaveContextTest.java
Modified: trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java?rev=4327&r1=4326&r2=4327&view=diff
==============================================================================
--- trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java (original)
+++ trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java Sun Aug 23 19:40:56 2015
@@ -44,6 +44,7 @@
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.net.CookieManager;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.security.DataExpiredException;
import net.shibboleth.utilities.java.support.security.DataSealer;
@@ -97,6 +98,9 @@
/** Servlet request. */
@NonnullAfterInit private HttpServletRequest httpServletRequest;
+ /** Manages creation of cookies. */
+ @NonnullAfterInit private CookieManager cookieManager;
+
/** Label used to track storage. */
@Nonnull @NotEmpty private String storageName;
@@ -128,6 +132,26 @@
httpServletRequest = Constraint.isNotNull(request, "HttpServletRequest cannot be null");
}
+
+ /**
+ * Get the {@link CookieManager} to use.
+ *
+ * @return the CookieManager to use
+ */
+ @NonnullAfterInit public CookieManager getCookieManager() {
+ return cookieManager;
+ }
+
+ /**
+ * Set the {@link CookieManager} to use.
+ *
+ * @param manager the CookieManager to use.
+ */
+ public void setCookieManager(@Nonnull final CookieManager manager) {
+ ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+
+ cookieManager = Constraint.isNotNull(manager, "CookieManager cannot be null");
+ }
/**
* Get the label to use for storage tracking.
@@ -137,7 +161,7 @@
@Nonnull @NotEmpty public String getStorageName() {
return storageName;
}
-
+
/**
* Set the label to use for storage tracking.
*
@@ -193,8 +217,8 @@
if (httpServletRequest == null) {
throw new ComponentInitializationException("HttpServletRequest must be set");
- } else if (dataSealer == null) {
- throw new ComponentInitializationException("DataSealer must be set");
+ } else if (dataSealer == null || cookieManager == null) {
+ throw new ComponentInitializationException("DataSealer and CookieManager must be set");
}
}
Modified: trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/LoadClientStorageServices.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/LoadClientStorageServices.java?rev=4327&r1=4326&r2=4327&view=diff
==============================================================================
--- trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/LoadClientStorageServices.java (original)
+++ trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/LoadClientStorageServices.java Sun Aug 23 19:40:56 2015
@@ -171,7 +171,7 @@
if (useLS) {
loadFromLocalStorage(storageService);
} else {
- loadFromCookie(storageService);
[... 320 lines stripped ...]
More information about the commits
mailing list