Author: ghjboss
Date: 2011-10-10 12:00:54 -0400 (Mon, 10 Oct 2011)
New Revision: 7703
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/pom.xml
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
Log:
fix for JBEPP-1090
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java
===================================================================
---
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java 2011-10-10
15:38:44 UTC (rev 7702)
+++
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/IntegrationCache.java 2011-10-10
16:00:54 UTC (rev 7703)
@@ -6,6 +6,9 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
+import org.jboss.cache.eviction.ExpirationConfiguration;
+
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.User;
@@ -55,6 +58,8 @@
public static final String NODE_OBJECT_KEY = "object";
+ private int expiration = -1;
+
private Fqn getRootNode()
{
return Fqn.fromString("/" + MAIN_ROOT);
@@ -152,7 +157,8 @@
if (ioNode != null)
{
ioNode.put(NODE_OBJECT_KEY, id);
-
+ setExpiration(ioNode);
+
if (log.isLoggable(Level.FINER))
{
@@ -205,8 +211,9 @@
if (ioNode != null)
{
- ioNode.put(NODE_OBJECT_KEY, rootGroup);
-
+ setExpiration(ioNode);
+ ioNode.put(NODE_OBJECT_KEY, rootGroup);
+
if (log.isLoggable(Level.FINER))
{
@@ -241,5 +248,24 @@
return null;
}
+
+ public void setExpiration(Node node)
+ {
+ if (expiration != -1 && expiration > 0)
+ {
+ Long future = new Long(System.currentTimeMillis() + expiration);
+ node.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
+ }
+ }
+ public int getExpiration()
+ {
+ return expiration;
+ }
+
+ public void setExpiration(int expiration)
+ {
+ this.expiration = expiration;
+ }
+
}
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
===================================================================
---
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-10-10
15:38:44 UTC (rev 7702)
+++
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2011-10-10
16:00:54 UTC (rev 7703)
@@ -70,6 +70,8 @@
public static final String CACHE_CONFIG_STORE_OPTION = "storeCacheConfig";
+ public static final String CACHE_EXPIRATION = "cacheExpiration";
+
private IdentitySessionFactory identitySessionFactory;
private String config;
@@ -96,6 +98,7 @@
ValueParam realmName = initParams.getValueParam(REALM_NAME_OPTION);
ValueParam apiCacheConfig = initParams.getValueParam(CACHE_CONFIG_API_OPTION);
ValueParam storeCacheConfig = initParams.getValueParam(CACHE_CONFIG_STORE_OPTION);
+ ValueParam cacheExpirationParam = initParams.getValueParam(CACHE_EXPIRATION);
if (config == null && jndiName == null)
{
@@ -125,7 +128,16 @@
identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(),
"hibernateSessionFactory");
+
+ int expiration = -1;
+ if (cacheExpirationParam != null &&
+ cacheExpirationParam.getValue() != null &&
+ cacheExpirationParam.getValue().length() > 0)
+ {
+ expiration = Integer.decode(cacheExpirationParam.getValue());
+ }
+
if (apiCacheConfig != null)
{
InputStream configStream =
confManager.getInputStream(apiCacheConfig.getValue());
@@ -147,12 +159,14 @@
// PLIDM API cache
JBossCacheAPICacheProviderImpl apiCacheProvider = new
JBossCacheAPICacheProviderImpl();
+ apiCacheProvider.setExpiration(expiration);
apiCacheProvider.initialize(cache);
picketLinkIDMCache.register(apiCacheProvider);
identityConfiguration.getIdentityConfigurationRegistry().register(apiCacheProvider,
"apiCacheProvider");
//Integration cache
integrationCache = new IntegrationCache();
+ integrationCache.setExpiration(expiration);
integrationCache.initialize(cache);
picketLinkIDMCache.register(apiCacheProvider);
@@ -162,6 +176,7 @@
InputStream configStream =
confManager.getInputStream(storeCacheConfig.getValue());
JBossCacheIdentityStoreCacheProviderImpl storeCacheProvider = new
JBossCacheIdentityStoreCacheProviderImpl();
+ storeCacheProvider.setExpiration(expiration);
storeCacheProvider.initialize(configStream);
picketLinkIDMCache.register(storeCacheProvider);
identityConfiguration.getIdentityConfigurationRegistry().register(storeCacheProvider,
"storeCacheProvider");
Modified: epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/pom.xml 2011-10-10 15:38:44 UTC (rev
7702)
+++ epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/pom.xml 2011-10-10 16:00:54 UTC (rev
7703)
@@ -47,7 +47,7 @@
<org.gatein.common.version>2.0.3-GA</org.gatein.common.version>
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-GA</org.gatein.pc.version>
- <org.picketlink.idm>1.1.7.GA</org.picketlink.idm>
+ <org.picketlink.idm>1.1.9.GA</org.picketlink.idm>
<org.gatein.wsrp.version>2.0.0-epp51-GA</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
Modified:
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
---
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2011-10-10
15:38:44 UTC (rev 7702)
+++
epp/portal/branches/EPP_5_1_0_GA_JBEPP-1090/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2011-10-10
16:00:54 UTC (rev 7703)
@@ -109,6 +109,11 @@
<name>storeCacheConfig</name>
<value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
</value-param>
+
+ <value-param>
+ <name>cacheExpiration</name>
+ <value>2000</value>
+ </value-param>
</init-params>
</component>
Show replies by date