[gatein-commits] gatein SVN: r2105 - in portal/trunk: component/identity/src/main/java/org/exoplatform/services/organization/idm and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Mar 10 09:20:34 EST 2010


Author: bdaw
Date: 2010-03-10 09:20:33 -0500 (Wed, 10 Mar 2010)
New Revision: 2105

Added:
   portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml
Modified:
   portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
   portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
   portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
   portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
   portal/trunk/pom.xml
   portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
   portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml
Log:
- use PicketLink IDM 1.1.0.GA
- remove usage of exo CacheService in idm integration as it duplicates the IDM cache
- split JBossCache config file for IDM to have separate cluster config
- some defaults in IDM JBossCache config

Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java	2010-03-10 14:20:33 UTC (rev 2105)
@@ -79,7 +79,7 @@
       else
       {
          userQueryBuilder.page(0, 0);
-         UserQuery query = userQueryBuilder.createQuery();
+         UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
          return idmService.getIdentitySession().execute(query).size();
       }
 

Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java	2010-03-10 14:20:33 UTC (rev 2105)
@@ -50,12 +50,12 @@
 
    private Config configuration = new Config();
 
-   public PicketLinkIDMOrganizationServiceImpl(InitParams params, CacheService cservice, PicketLinkIDMService idmService)
+   public PicketLinkIDMOrganizationServiceImpl(InitParams params, PicketLinkIDMService idmService)
       throws Exception
    {
       groupDAO_ = new GroupDAOImpl(this, idmService);
-      userDAO_ = new UserDAOImpl(this, idmService, cservice);
-      userProfileDAO_ = new UserProfileDAOImpl(this, idmService, cservice);
+      userDAO_ = new UserDAOImpl(this, idmService);
+      userProfileDAO_ = new UserProfileDAOImpl(this, idmService);
       membershipDAO_ = new MembershipDAOImpl(this, idmService);
       membershipTypeDAO_ = new MembershipTypeDAOImpl(this, idmService);
 

Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java	2010-03-10 14:20:33 UTC (rev 2105)
@@ -53,11 +53,8 @@
 {
    private static org.slf4j.Logger log = LoggerFactory.getLogger(UserDAOImpl.class);
 
-
    private final PicketLinkIDMService service_;
 
-   private ExoCache cache_;
-
    private List<UserEventListener> listeners_ = new ArrayList<UserEventListener>(3);
 
    public static final String USER_PASSWORD = "password";
@@ -94,11 +91,10 @@
       USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
    }
 
-   public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService, CacheService cservice)
+   public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService)
       throws Exception
    {
       service_ = idmService;
-      cache_ = cservice.getCacheInstance(UserImpl.class.getName());
       this.orgService = orgService;
    }
 
@@ -163,7 +159,6 @@
       {
          postSave(user, false);
       }
-      cache_.put(user.getUserName(), user);
    }
 
    public User removeUser(String userName, boolean broadcast) throws Exception
@@ -184,7 +179,6 @@
 
       if (foundUser == null)
       {
-         cache_.remove(userName);
          return null;
       }
 
@@ -221,7 +215,6 @@
       {
          postDelete(exoUser);
       }
-      cache_.remove(userName);
       return exoUser;
    }
 
@@ -230,16 +223,8 @@
    {
       IdentitySession session = service_.getIdentitySession();
 
-      User user = (User)cache_.get(userName);
-      if (user != null)
-      {
-         return user;
-      }
-      user = getPopulatedUser(userName, session);
-      if (user != null)
-      {
-         cache_.put(userName, user);
-      }
+      User user = getPopulatedUser(userName, session);
+
       return user;
    }
 

Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java	2010-03-10 14:20:33 UTC (rev 2105)
@@ -52,17 +52,14 @@
 
    private PicketLinkIDMService service_;
 
-   private ExoCache cache_;
-
    private List<UserProfileEventListener> listeners_;
 
    private PicketLinkIDMOrganizationServiceImpl orgService;
 
-   public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service, CacheService cservice)
+   public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
       throws Exception
    {
       service_ = service;
-      cache_ = cservice.getCacheInstance(getClass().getName());
       listeners_ = new ArrayList<UserProfileEventListener>(3);
       this.orgService = orgService;
    }
@@ -106,8 +103,6 @@
          postSave(profile, true);
       }
 
-      cache_.put(profile.getUserName(), profile);
-
    }
 
    public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
@@ -129,7 +124,6 @@
             {
                postDelete(profile);
             }
-            cache_.remove(userName);
             return profile;
          }
          catch (Exception exp)
@@ -137,7 +131,6 @@
             return null;
          }
       }
-      cache_.remove(userName);
       return null;
    }
 
@@ -161,11 +154,7 @@
          return null;
       }
 
-      UserProfile up = (UserProfile)cache_.get(userName);
-      if (up == null)
-      {
-         up = getProfile(userName);
-      }
+      UserProfile up = getProfile(userName);
 
       //
       if (up == null)
@@ -173,9 +162,7 @@
          up = NOT_FOUND;
       }
 
-      //
-      cache_.put(userName, up);
-
+      
       // Just to avoid to return a shared object between many threads
       // that would not be thread safe nor corrct
       if (up == NOT_FOUND)

Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/pom.xml	2010-03-10 14:20:33 UTC (rev 2105)
@@ -46,7 +46,7 @@
       <org.gatein.common.version>2.0.0-CR03</org.gatein.common.version>
       <org.gatein.wci.version>2.0.0-CR02</org.gatein.wci.version>
       <org.gatein.pc.version>2.1.0-CR05</org.gatein.pc.version>
-      <org.picketlink.idm>1.1.0.Beta10</org.picketlink.idm>
+      <org.picketlink.idm>1.1.0.GA</org.picketlink.idm>
       <org.gatein.wsrp.version>1.0.0-Beta09</org.gatein.wsrp.version>
       <org.gatein.mop.version>1.0.0-CR03</org.gatein.mop.version>
       <org.slf4j.version>1.5.6</org.slf4j.version>

Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml	2010-03-10 14:20:33 UTC (rev 2105)
@@ -21,8 +21,8 @@
 -->
 
 <configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-               xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-               xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+               xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+               xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
 
 
   <component>
@@ -87,6 +87,11 @@
         <name>cacheConfig</name>
         <value>war:/conf/organization/picketlink-idm/jboss-cache.xml</value>
       </value-param>
+      
+      <!--<value-param profiles="cluster">
+        <name>cacheConfig</name>
+        <value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
+      </value-param>-->
 
     </init-params>
   </component>

Copied: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml (from rev 2082, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml)
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml	                        (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml	2010-03-10 14:20:33 UTC (rev 2105)
@@ -0,0 +1,18 @@
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+  <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+    <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+    <jgroupsConfig multiplexerStack="jcr.stack" />
+    <sync />
+  </clustering>
+
+  <!-- Eviction configuration -->
+  <eviction wakeUpInterval="5000">
+    <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
+      eventQueueSize="1000000">
+      <property name="maxNodes" value="1000000" />
+      <property name="timeToLive" value="120000" />
+    </default>
+  </eviction>
+
+</jbosscache>

Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml	2010-03-10 14:09:45 UTC (rev 2104)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml	2010-03-10 14:20:33 UTC (rev 2105)
@@ -1,5 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xmlns="urn:jboss:jbosscache-core:config:3.0">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
 
-</jbosscache>
+  <!-- Eviction configuration -->
+  <eviction wakeUpInterval="5000">
+    <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
+      eventQueueSize="1000000">
+      <property name="maxNodes" value="1000000" />
+      <property name="timeToLive" value="120000" />
+    </default>
+  </eviction>
+
+</jbosscache>
\ No newline at end of file



More information about the gatein-commits mailing list