[java-identity-provider COMMIT] in /trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl: StorageBack...

noreply at shibboleth.net noreply at shibboleth.net
Mon Sep 30 12:17:22 EDT 2013


Author: scantor
Date: Mon Sep 30 12:17:22 2013
New Revision: 4810

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4810&view=rev
Log:
Add secondary index mgmt

Modified:
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedIdPSession.java
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java

Modified: trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedIdPSession.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedIdPSession.java?rev=4810&r1=4809&r2=4810&view=diff
==============================================================================
--- trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedIdPSession.java (original)
+++ trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedIdPSession.java Mon Sep 30 12:17:22 2013
@@ -303,8 +303,6 @@
                     // Checkstyle: EmptyBlock ON
                 }
             }
-        } else {
-            log.warn("Request for ServiceSessions will return nothing, ServiceManager is not tracking them");
         }
         
         return super.getServiceSessions();
@@ -341,7 +339,6 @@
             // Checkstyle: EmptyBlock ON
             return result;
         } else {
-            log.warn("Request for ServiceSession will return nothing, ServiceManager is not tracking them");
             return null;
         }
     }
@@ -349,36 +346,41 @@
     /** {@inheritDoc} */
     @Nullable public ServiceSession addServiceSession(@Nonnull final ServiceSession serviceSession)
             throws SessionException {
-        try {
-            // Store the record.
-            if (!saveServiceSessionToStorage(serviceSession) && !sessionManager.isMaskStorageFailure()) {
-                throw new SessionException("Unable to save ServiceSession to storage");
-            }
-            ServiceSession prev = super.addServiceSession(serviceSession);
-            if (prev == null) {
-                // If no previous record, the add operation changed the master record, requiring an update.
-                int attempts = 10;
-                boolean success = writeToStorage();
-                while (!success && attempts-- > 0) {
-                    // The record may have changed underneath, see if we need to reapply the add.
-                    if (!getServiceSessionMap().containsKey(serviceSession.getId())) {
-                        super.addServiceSession(serviceSession);
-                        success = writeToStorage();
-                    } else {
-                        success = true;
+        if (sessionManager.isTrackServiceSessions()) {
+            try {
+                // Store the record.
+                if (!saveServiceSessionToStorage(serviceSession) && !sessionManager.isMaskStorageFailure()) {
+                    throw new SessionException("Unable to save ServiceSession to storage");
+                }
+                ServiceSession prev = super.addServiceSession(serviceSession);
+                if (prev == null) {
+                    // If no previous record, the add operation changed the master record, requiring an update.
+                    int attempts = 10;
+                    boolean success = writeToStorage();
+                    while (!success && attempts-- > 0) {
+                        // The record may have changed underneath, see if we need to reapply the add.
+                        if (!getServiceSessionMap().containsKey(serviceSession.getId())) {
+                            super.addServiceSession(serviceSession);
+                            success = writeToStorage();
+                        } else {
+                            success = true;
+                        }
                     }
-                }
-                if (!success) {
-                    log.error("Exhausted retry attempts updating record for session {}", getId());
-                }
-            }
-            return prev;
-        } catch (IOException e) {
-            log.error("Exception saving ServiceSession record for session " + getId()
-                    + " and service " + serviceSession.getId(), e);
-            if (!sessionManager.isMaskStorageFailure()) {
-                throw new SessionException("Exception saving ServiceSession record to storage", e);
-            }
+                    if (!success) {
+                        log.error("Exhausted retry attempts updating record for session {}", getId());
+                    }
+                }
+                sessionManager.indexByServiceSession(this, serviceSession, 10);
+                return prev;
+            } catch (IOException e) {
+                log.error("Exception saving ServiceSession record for session " + getId()
+                        + " and service " + serviceSession.getId(), e);
+                if (!sessionManager.isMaskStorageFailure()) {

[... 133 lines stripped ...]


More information about the commits mailing list