Repository: cxf Updated Branches: refs/heads/master b49075882 -> b418fd795
Updating Hazelcast and Spring LDAP Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b418fd79 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b418fd79 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b418fd79 Branch: refs/heads/master Commit: b418fd7952dc36f1a3e577e457833588a2056104 Parents: b490758 Author: Colm O hEigeartaigh <[email protected]> Authored: Tue Dec 13 12:21:49 2016 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Tue Dec 13 12:21:49 2016 +0000 ---------------------------------------------------------------------- parent/pom.xml | 4 +-- .../cxf/sts/cache/HazelCastTokenStore.java | 26 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/b418fd79/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index a951acc..668d60c 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -84,7 +84,7 @@ <cxf.ehcache3.version>3.0.3</cxf.ehcache3.version> <cxf.fastinfoset.bundle.version>1.2.13_1</cxf.fastinfoset.bundle.version> <cxf.guava.version>18.0</cxf.guava.version> - <cxf.hazelcast.version>1.9.4</cxf.hazelcast.version> + <cxf.hazelcast.version>3.7.4</cxf.hazelcast.version> <cxf.httpcomponents.asyncclient.version>4.1.2</cxf.httpcomponents.asyncclient.version> <cxf.httpcomponents.asyncclient.version.range>[4.0,4.2)</cxf.httpcomponents.asyncclient.version.range> <cxf.httpcomponents.client.version>4.5.2</cxf.httpcomponents.client.version> @@ -148,7 +148,7 @@ <cxf.spring.boot.version>1.3.6.RELEASE</cxf.spring.boot.version> <cxf.spring.security.version>4.2.0.RELEASE</cxf.spring.security.version> <cxf.spring.osgi.version>1.2.1</cxf.spring.osgi.version> - <cxf.spring.ldap.version>2.1.0.RELEASE</cxf.spring.ldap.version> + <cxf.spring.ldap.version>2.2.0.RELEASE</cxf.spring.ldap.version> <cxf.spring.mock>spring-test</cxf.spring.mock> <cxf.swagger.version>1.3.13</cxf.swagger.version> <cxf.swagger2.version>1.5.10</cxf.swagger2.version> http://git-wip-us.apache.org/repos/asf/cxf/blob/b418fd79/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastTokenStore.java ---------------------------------------------------------------------- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastTokenStore.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastTokenStore.java index 0dc3354..629292a 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastTokenStore.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastTokenStore.java @@ -33,7 +33,7 @@ import org.apache.cxf.ws.security.tokenstore.SecurityToken; import org.apache.cxf.ws.security.tokenstore.TokenStore; public class HazelCastTokenStore implements TokenStore { - + public static final long DEFAULT_TTL = 3600L; public static final long MAX_TTL = DEFAULT_TTL * 12L; @@ -42,11 +42,11 @@ public class HazelCastTokenStore implements TokenStore { private long ttl = DEFAULT_TTL; private HazelcastInstance hazelcastInstance; private String mapName; - + public HazelCastTokenStore(String mapName) { this.mapName = mapName; } - + /** * Get the Hazelcast instance * If null, return Default instance @@ -54,7 +54,7 @@ public class HazelCastTokenStore implements TokenStore { */ public HazelcastInstance getHazelcastInstance() { if (hazelcastInstance == null) { - hazelcastInstance = Hazelcast.getDefaultInstance(); + hazelcastInstance = Hazelcast.newHazelcastInstance(); } return hazelcastInstance; } @@ -75,7 +75,7 @@ public class HazelCastTokenStore implements TokenStore { public void setTTL(long newTtl) { ttl = newTtl; } - + /** * Get the (default) TTL value in seconds * @return the (default) TTL value in seconds @@ -83,7 +83,7 @@ public class HazelCastTokenStore implements TokenStore { public long getTTL() { return ttl; } - + public void add(SecurityToken token) { if (token != null && !StringUtils.isEmpty(token.getId())) { int parsedTTL = getTTL(token); @@ -92,7 +92,7 @@ public class HazelCastTokenStore implements TokenStore { } } } - + public void add(String identifier, SecurityToken token) { if (token != null && !StringUtils.isEmpty(identifier)) { int parsedTTL = getTTL(token); @@ -101,13 +101,13 @@ public class HazelCastTokenStore implements TokenStore { } } } - + public void remove(String identifier) { if (!StringUtils.isEmpty(identifier) && getCacheMap().containsKey(identifier)) { getCacheMap().remove(identifier); } } - + public Collection<String> getTokenIdentifiers() { return CastUtils.cast((Collection<?>)getCacheMap().keySet()); } @@ -115,7 +115,7 @@ public class HazelCastTokenStore implements TokenStore { public SecurityToken getToken(String identifier) { return (SecurityToken)getCacheMap().get(identifier); } - + public void destroy() { if (hazelcastInstance != null) { hazelcastInstance.getLifecycleService().shutdown(); @@ -131,7 +131,7 @@ public class HazelCastTokenStore implements TokenStore { if (expiryTime < 0) { return 0; } - + parsedTTL = (int)expiryTime; if (expiryTime != (long)parsedTTL || parsedTTL > MAX_TTL) { // Default to configured value @@ -151,13 +151,13 @@ public class HazelCastTokenStore implements TokenStore { } return parsedTTL; } - + private IMap<Object, Object> getCacheMap() { if (this.cacheMap == null) { this.cacheMap = getHazelcastInstance().getMap(mapName); } return this.cacheMap; } - + }
