public ClientCacheRule withPoolSubscription(boolean enabled) { withCacheSetup(cf -> cf.setPoolSubscriptionEnabled(enabled)); return this; }
@Deprecated public static ClientCache createClientCache(String username, String password, int serverPort, Properties extraProperties) { Properties props = new Properties(); props.setProperty(UserPasswordAuthInit.USER_NAME, username); props.setProperty(UserPasswordAuthInit.PASSWORD, password); props.setProperty(SECURITY_CLIENT_AUTH_INIT, UserPasswordAuthInit.class.getName()); props.setProperty(LOCATORS, ""); props.setProperty(MCAST_PORT, "0"); props.putAll(extraProperties); if (Version.CURRENT.ordinal() >= 75) { props.setProperty(SERIALIZABLE_OBJECT_FILTER, "org.apache.geode.security.query.data.*"); } ClientCache cache = new ClientCacheFactory(props).setPoolSubscriptionEnabled(true) .addPoolServer("localhost", serverPort).create(); return cache; }
@Override public void run2() throws CacheException { getSystem(properties); final ClientCacheFactory ccf = new ClientCacheFactory(properties); for (int i = 0; i < servers.length; i++) { ccf.addPoolServer(NetworkUtils.getServerHostName(servers[i].getHost()), ports[i]); } ccf.setPoolSubscriptionEnabled(true); ccf.setPoolSubscriptionRedundancy(redundancyLevel); ClientCache cache = (ClientCache) getClientCache(ccf); } });
@Test(expected = GemFireConfigException.class) public void clientIsPreventedFromConnectingToLocatorAsServer() { IgnoredException.addIgnoredException("Improperly configured client detected"); ClientCacheFactory clientCacheFactory = new ClientCacheFactory(); clientCacheFactory.addPoolServer("localhost", DistributedTestUtils.getDUnitLocatorPort()); clientCacheFactory.setPoolSubscriptionEnabled(true); getClientCache(clientCacheFactory); Region region = ((ClientCache) cache).createClientRegionFactory(ClientRegionShortcut.PROXY) .create(REGION_NAME1); region.registerInterest(k1); }
@Before public void setup() { serverVM = VM.getVM(0); clientVM = VM.getVM(1); final int locatorPort = DistributedTestUtils.getDUnitLocatorPort(); // create a server cache and a client cache serverVM.invoke(() -> { String locatorSpec = "localhost[" + locatorPort + "]"; CacheFactory config = new CacheFactory(); config.set( ConfigurationProperties.LOCATORS, locatorSpec); config.set( ConfigurationProperties.NAME, "server1"); Cache serverCache = config.create(); cache = serverCache; CacheServer cacheServer = serverCache.addCacheServer(); cacheServer.start(); }); clientVM.invoke(() -> { ClientCacheFactory config = new ClientCacheFactory(); config.addPoolLocator("localhost", locatorPort); config.setPoolSubscriptionEnabled(true); cache = config.create(); }); }
.setPoolThreadLocalConnections(poolAttr.getThreadLocalConnections()) .setPoolReadTimeout(poolAttr.getReadTimeout()) .setPoolSubscriptionEnabled(poolAttr.getSubscriptionEnabled()) .setPoolPRSingleHopEnabled(poolAttr.getPRSingleHopEnabled()) .setPoolSubscriptionRedundancy(poolAttr.getSubscriptionRedundancy())
private Example(String username) { Properties props = new Properties(); props.setProperty("security-username", username); props.setProperty("security-client-auth-init", ExampleAuthInit.class.getName()); props.setProperty("ssl-enabled-components", "all"); props.setProperty("ssl-keystore", "keystore.jks"); props.setProperty("ssl-keystore-password", "password"); props.setProperty("ssl-truststore", "truststore.jks"); props.setProperty("ssl-truststore-password", "password"); // connect to the locator using default port 10334 cache = new ClientCacheFactory(props).setPoolSubscriptionEnabled(true) .addPoolLocator("localhost", 10334).create(); region1 = cache.<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create(REGION1); region2 = cache.<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create(REGION2); }
private ClientCache connectToLocallyRunningGeode() { ClientCache cache = new ClientCacheFactory().addPoolLocator("127.0.0.1", 10334) .setPoolSubscriptionEnabled(true).set("log-level", "WARN").create(); return cache; }
mockPoolFactory.setSubscriptionEnabled(invocation.getArgument(0)); return clientCacheFactorySpy; }).when(clientCacheFactorySpy).setPoolSubscriptionEnabled(anyBoolean());
clientCacheFactory.setPoolStatisticInterval(pool.getStatisticInterval(getStatisticsInterval())); clientCacheFactory.setPoolSubscriptionAckInterval(pool.getSubscriptionAckInterval(getSubscriptionAckInterval())); clientCacheFactory.setPoolSubscriptionEnabled(pool.getSubscriptionEnabled(getSubscriptionEnabled())); clientCacheFactory.setPoolSubscriptionMessageTrackingTimeout(pool.getSubscriptionMessageTrackingTimeout(getSubscriptionMessageTrackingTimeout())); clientCacheFactory.setPoolSubscriptionRedundancy(pool.getSubscriptionRedundancy(getSubscriptionRedundancy()));
clientCacheFactory.setPoolStatisticInterval(pool.getStatisticInterval(getStatisticsInterval())); clientCacheFactory.setPoolSubscriptionAckInterval(pool.getSubscriptionAckInterval(getSubscriptionAckInterval())); clientCacheFactory.setPoolSubscriptionEnabled(pool.getSubscriptionEnabled(getSubscriptionEnabled())); clientCacheFactory.setPoolSubscriptionMessageTrackingTimeout(pool.getSubscriptionMessageTrackingTimeout(getSubscriptionMessageTrackingTimeout())); clientCacheFactory.setPoolSubscriptionRedundancy(pool.getSubscriptionRedundancy(getSubscriptionRedundancy()));