Class InfinispanUtil
- java.lang.Object
- 
- org.keycloak.connections.infinispan.InfinispanUtil
 
- 
 public class InfinispanUtil extends Object - Author:
- Marek Posolda
 
- 
- 
Field SummaryFields Modifier and Type Field Description static org.infinispan.commons.time.TimeServiceKEYCLOAK_TIME_SERVICEprotected static org.jboss.logging.Loggerloggerstatic intMAXIMUM_REPLACE_RETRIES
 - 
Constructor SummaryConstructors Constructor Description InfinispanUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidconfigureTransport(org.infinispan.configuration.global.GlobalConfigurationBuilder gcb, String nodeName, String siteName, String jgroupsUdpMcastAddr, String jgroupsConfigPath)static org.infinispan.configuration.cache.ConfigurationBuildercreateCacheConfigurationBuilder()static org.infinispan.configuration.cache.ConfigurationBuildergetActionTokenCacheConfig()static org.infinispan.client.hotrod.RemoteCachegetRemoteCache(org.infinispan.Cache ispnCache)static Set<org.infinispan.persistence.remote.RemoteStore>getRemoteStores(org.infinispan.Cache ispnCache)static TopologyInfogetTopologyInfo(KeycloakSession session)static booleanisCoordinator(org.infinispan.Cache cache)static RunnablesetTimeServiceToKeycloakTime(org.infinispan.manager.EmbeddedCacheManager cacheManager)Replaces theTimeServicein infinispan with the one that respects KeycloakTime.static longtoHotrodTimeMs(org.infinispan.commons.api.BasicCache ispnCache, long lifespanOrigMs)Convert the given value to the proper value, which can be used when calling operations for the infinispan remoteCache.
 
- 
- 
- 
Field Detail- 
loggerprotected static final org.jboss.logging.Logger logger 
 - 
MAXIMUM_REPLACE_RETRIESpublic static final int MAXIMUM_REPLACE_RETRIES - See Also:
- Constant Field Values
 
 - 
KEYCLOAK_TIME_SERVICEpublic static final org.infinispan.commons.time.TimeService KEYCLOAK_TIME_SERVICE 
 
- 
 - 
Method Detail- 
getRemoteStorespublic static Set<org.infinispan.persistence.remote.RemoteStore> getRemoteStores(org.infinispan.Cache ispnCache) 
 - 
getRemoteCachepublic static org.infinispan.client.hotrod.RemoteCache getRemoteCache(org.infinispan.Cache ispnCache) 
 - 
getTopologyInfopublic static TopologyInfo getTopologyInfo(KeycloakSession session) 
 - 
isCoordinatorpublic static boolean isCoordinator(org.infinispan.Cache cache) - Parameters:
- cache-
- Returns:
- true if cluster coordinator OR if it's local cache
 
 - 
toHotrodTimeMspublic static long toHotrodTimeMs(org.infinispan.commons.api.BasicCache ispnCache, long lifespanOrigMs)Convert the given value to the proper value, which can be used when calling operations for the infinispan remoteCache. Infinispan HotRod protocol of versions older than 3.0 uses the "lifespan" or "maxIdle" as the normal expiration time when the value is 30 days or less. However for the bigger values, it assumes that the value is unix timestamp.- Parameters:
- ispnCache-
- lifespanOrigMs-
- Returns:
 
 - 
configureTransportpublic static void configureTransport(org.infinispan.configuration.global.GlobalConfigurationBuilder gcb, String nodeName, String siteName, String jgroupsUdpMcastAddr, String jgroupsConfigPath)
 - 
createCacheConfigurationBuilderpublic static org.infinispan.configuration.cache.ConfigurationBuilder createCacheConfigurationBuilder() 
 - 
getActionTokenCacheConfigpublic static org.infinispan.configuration.cache.ConfigurationBuilder getActionTokenCacheConfig() 
 - 
setTimeServiceToKeycloakTimepublic static Runnable setTimeServiceToKeycloakTime(org.infinispan.manager.EmbeddedCacheManager cacheManager) Replaces theTimeServicein infinispan with the one that respects KeycloakTime.- Parameters:
- cacheManager-
- Returns:
- Runnable to revert replacement of the infinispan time service
 
 
- 
 
-