[jboss-cvs] Picketlink SVN: r247 - idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 17 06:28:37 EDT 2010


Author: bdaw
Date: 2010-05-17 06:28:36 -0400 (Mon, 17 May 2010)
New Revision: 247

Modified:
   idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java
Log:
- PLIDM-14 - Users are removed from LDAP but not from DB with Fallback repository

Modified: idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
--- idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java	2010-05-14 19:20:55 UTC (rev 246)
+++ idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/repository/FallbackIdentityStoreRepository.java	2010-05-17 10:28:36 UTC (rev 247)
@@ -476,6 +476,7 @@
    {
       IdentityStore targetStore = resolveIdentityStore(identity);
       IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx);
+      IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultIdentityStore, invocationCtx);
 
       if (isIdentityStoreReadOnly(targetStore))
       {
@@ -492,9 +493,26 @@
       {
          if (log.isLoggable(Level.INFO))
          {
-            log.log(Level.INFO, "Failed to remove IdentityObject: ", e);
+            log.log(Level.INFO, "Failed to remove IdentityObject from target store: ", e);
          }
       }
+
+      // Sync remove in default store
+      if (targetStore != defaultIdentityStore && hasIdentityObject(defaultCtx, defaultIdentityStore, identity))
+      {
+
+         try
+         {
+            defaultIdentityStore.removeIdentityObject(defaultCtx, identity);
+         }
+         catch (IdentityException e)
+         {
+            if (log.isLoggable(Level.INFO))
+            {
+               log.log(Level.INFO, "Failed to remove IdentityObject from default store: ", e);
+            }
+         }
+      }
    }
 
    public int getIdentityObjectsCount(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityType) throws IdentityException




More information about the jboss-cvs-commits mailing list