[java-opensaml COMMIT] in /trunk/opensaml-storage-impl: pom.xml src/main/java/org/opensaml/storage/impl/client/Client...

noreply at shibboleth.net noreply at shibboleth.net
Thu Aug 13 22:48:47 EDT 2015


Author: scantor
Date: Thu Aug 13 22:48:47 2015
New Revision: 4321

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4321&view=rev
Log:
IDP-594 - Action and unit test to prepare for storage load.

Added:
    trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageLoadContext.java   (with props)
    trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContext.java   (with props)
    trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/
    trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/client/PopulateClientStorageLoadContextTest.java   (with props)
Modified:
    trunk/opensaml-storage-impl/pom.xml
    trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/client/ClientStorageService.java

Modified: trunk/opensaml-storage-impl/pom.xml
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-impl/pom.xml?rev=4321&r1=4320&r2=4321&view=diff
==============================================================================
--- trunk/opensaml-storage-impl/pom.xml	(original)
+++ trunk/opensaml-storage-impl/pom.xml	Thu Aug 13 22:48:47 2015
@@ -72,6 +72,14 @@
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>opensaml-storage-api</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>opensaml-profile-api</artifactId>
             <version>${project.version}</version>
             <type>test-jar</type>
             <scope>test</scope>

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=4321&r1=4320&r2=4321&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	Thu Aug 13 22:48:47 2015
@@ -38,7 +38,6 @@
 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;
@@ -79,9 +78,6 @@
     /** Servlet request. */
     @NonnullAfterInit private HttpServletRequest httpServletRequest;
     
-    /** Manages creation of cookies if supported/needed. */
-    @NonnullAfterInit private CookieManager cookieManager;
-    
     /** Label used to track storage. */
     @Nonnull @NotEmpty private String storageName;
     
@@ -113,17 +109,6 @@
         
         httpServletRequest = Constraint.isNotNull(request, "HttpServletRequest cannot be null");
     }
-    
-    /**
-     * 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.
@@ -167,28 +152,27 @@
         keyStrategy = strategy;
     }
 
-    /**
-     * Check whether data from the client has been loaded into the current session.
-     * 
-     * <p>This method should <strong>not</strong> be called while holding the session lock
-     * returned by {@link #getLock()}.</p>
-     *  
-     * @return true iff the {@link HttpSession} contains a storage object
-     */
-    public boolean isLoaded() {
-       final Lock lock = getLock().readLock();
-       try {
-           final HttpSession session = Constraint.isNotNull(httpServletRequest.getSession(),
-                   "HttpSession cannot be null");
-           return session.getAttribute(STORAGE_ATTRIBUTE + '.' + storageName) instanceof ClientStorageServiceStore;
-       } finally {
-           lock.unlock();
-       }
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    @Nonnull public ReadWriteLock getLock() {
+    /** {@inheritDoc} */
+    @Override
+    protected void doInitialize() throws ComponentInitializationException {
+        super.doInitialize();
+        
+        if (httpServletRequest == null) {
+            throw new ComponentInitializationException("HttpServletRequest must be set");
+        } else if (dataSealer == null) {

[... 107 lines stripped ...]


More information about the commits mailing list