@Override public void accept(RemoteStoreConfigurationBuilder builder) { builder.remoteCacheName(this.remoteCacheName) .socketTimeout(this.socketTimeout) .tcpNoDelay(this.tcpNoDelay) ; for (Supplier<OutboundSocketBinding> bindingDependency : this.bindings) { OutboundSocketBinding binding = bindingDependency.get(); builder.addServer().host(binding.getUnresolvedDestinationAddress()).port(binding.getDestinationPort()); } } }
@Override public void accept(RemoteStoreConfigurationBuilder builder) { builder.remoteCacheName(this.remoteCacheName) .socketTimeout(this.socketTimeout) .tcpNoDelay(this.tcpNoDelay) ; for (Supplier<OutboundSocketBinding> bindingDependency : this.bindings) { OutboundSocketBinding binding = bindingDependency.get(); builder.addServer().host(binding.getUnresolvedDestinationAddress()).port(binding.getDestinationPort()); } } }
builder.remoteCacheName(value); break;
protected PersistenceConfigurationBuilder createCacheStoreConfig(String cacheName, int port, PersistenceConfigurationBuilder persistence) { persistence.addStore(RemoteStoreConfigurationBuilder.class) .remoteCacheName(cacheName) .hotRodWrapping(true) .addServer() .host("localhost") .port(port); return persistence; }
builder.remoteCacheName(store.get(ModelKeys.CACHE).asString());
private void configureRemoteActionTokenCacheStore(ConfigurationBuilder builder, boolean async) { String jdgServer = config.get("remoteStoreHost", "localhost"); Integer jdgPort = config.getInt("remoteStorePort", 11222); builder.persistence() .passivation(false) .addStore(RemoteStoreConfigurationBuilder.class) .fetchPersistentState(false) .ignoreModifications(false) .purgeOnStartup(false) .preload(true) .shared(true) .remoteCacheName(InfinispanConnectionProvider.ACTION_TOKEN_CACHE) .rawValues(true) .forceReturnValues(false) .marshaller(KeycloakHotRodMarshallerFactory.class.getName()) .protocolVersion(getHotrodVersion()) .addServer() .host(jdgServer) .port(jdgPort) .async() .enabled(async); }
private void configureRemoteCacheStore(ConfigurationBuilder builder, boolean async, String cacheName, boolean sessionCache) { String jdgServer = config.get("remoteStoreHost", "localhost"); Integer jdgPort = config.getInt("remoteStorePort", 11222); builder.persistence() .passivation(false) .addStore(RemoteStoreConfigurationBuilder.class) .fetchPersistentState(false) .ignoreModifications(false) .purgeOnStartup(false) .preload(false) .shared(true) .remoteCacheName(cacheName) .rawValues(true) .forceReturnValues(false) .marshaller(KeycloakHotRodMarshallerFactory.class.getName()) .protocolVersion(getHotrodVersion()) .addServer() .host(jdgServer) .port(jdgPort) // .connectionPool() // .maxActive(100) // .exhaustedAction(ExhaustedAction.CREATE_NEW) .async() .enabled(async); }
@Override protected PersistenceConfigurationBuilder createCacheStoreConfig(PersistenceConfigurationBuilder persistence, boolean preload) { localCacheManager = TestCacheManagerFactory.createCacheManager(hotRodCacheConfiguration()); hrServer = HotRodClientTestingUtil.startHotRodServer(localCacheManager); persistence .addStore(RemoteStoreConfigurationBuilder.class) .remoteCacheName(BasicCacheContainer.DEFAULT_CACHE_NAME) .preload(preload) .addServer() .host("localhost") .port(hrServer.getPort()); return persistence; }
.persistence() .addStore(RemoteStoreConfigurationBuilder.class) .remoteCacheName(REMOTE_CACHE) .remoteSecurity(); remoteSecurity
private CacheDefinitionBuilder addNewCache() { if (configurationBuilder == null) configurationBuilder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC); if (remotePort != null) { RemoteStoreConfigurationBuilder store = configurationBuilder.persistence().addStore(RemoteStoreConfigurationBuilder.class); store.hotRodWrapping(true) .remoteCacheName(name).protocolVersion(protocolVersion).shared(true) .addServer().host("localhost").port(remotePort); if (builder.trustStoreFileName != null) { store.remoteSecurity().ssl().enable().trustStoreFileName(builder.trustStoreFileName).trustStorePassword(builder.trustStorePassword); } if (builder.keyStoreFileName != null) { store.remoteSecurity().ssl().keyStoreFileName(builder.keyStoreFileName).keyStorePassword(builder.keyStorePassword); } } builder.addCache(name, configurationBuilder); return new CacheDefinitionBuilder(builder); } }
@Override protected AdvancedLoadWriteStore createStore() throws Exception { ConfigurationBuilder localBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); localBuilder.memory().evictionType(EvictionType.COUNT).size(WRITE_DELETE_BATCH_MAX_ENTRIES) .expiration().wakeUpInterval(10L); localCacheManager = TestCacheManagerFactory.createCacheManager( new GlobalConfigurationBuilder().defaultCacheName(REMOTE_CACHE), hotRodCacheConfiguration(localBuilder)); localCacheManager.getCache(REMOTE_CACHE); TestingUtil.replaceComponent(localCacheManager, TimeService.class, timeService, true); localCacheManager.getCache(REMOTE_CACHE).getAdvancedCache().getComponentRegistry().rewire(); hrServer = HotRodClientTestingUtil.startHotRodServer(localCacheManager); ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); RemoteStoreConfigurationBuilder storeConfigurationBuilder = builder .persistence() .addStore(RemoteStoreConfigurationBuilder.class) .rawValues(true) .remoteCacheName(REMOTE_CACHE); storeConfigurationBuilder .addServer() .host(hrServer.getHost()) .port(hrServer.getPort()); RemoteStore remoteStore = new RemoteStore(); remoteStore.init(createContext(builder.build())); return remoteStore; }
@Override protected AdvancedLoadWriteStore createStore() throws Exception { ConfigurationBuilder localBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); localBuilder.memory().evictionType(EvictionType.COUNT).size(WRITE_DELETE_BATCH_MAX_ENTRIES).expiration().wakeUpInterval(10L); // Set it to dist so it has segments localBuilder.clustering().cacheMode(CacheMode.DIST_SYNC); GlobalConfigurationBuilder globalConfig = new GlobalConfigurationBuilder().clusteredDefault(); globalConfig.globalJmxStatistics().defaultCacheName(REMOTE_CACHE); localCacheManager = TestCacheManagerFactory.createClusteredCacheManager( globalConfig, hotRodCacheConfiguration(localBuilder)); localCacheManager.getCache(REMOTE_CACHE); TestingUtil.replaceComponent(localCacheManager, TimeService.class, timeService, true); localCacheManager.getCache(REMOTE_CACHE).getAdvancedCache().getComponentRegistry().rewire(); hrServer = HotRodClientTestingUtil.startHotRodServer(localCacheManager); // In case if the server has to unmarshall the value, make sure to use the same marshaller hrServer.setMarshaller(getMarshaller()); ConfigurationBuilder builder = TestCacheManagerFactory .getDefaultCacheConfiguration(false); RemoteStoreConfigurationBuilder storeConfigurationBuilder = builder .persistence() .addStore(RemoteStoreConfigurationBuilder.class) .remoteCacheName(REMOTE_CACHE); storeConfigurationBuilder .addServer() .host(hrServer.getHost()) .port(hrServer.getPort()); RemoteStore remoteStore = new RemoteStore(); remoteStore.init(createContext(builder.build())); return remoteStore; }