@Override public RemoteCacheManager get() { Configuration configuration = this.configuration.get(); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration); remoteCacheManager.start(); InfinispanLogger.ROOT_LOGGER.remoteCacheContainerStarted(this.name); return remoteCacheManager; }
/** * Produces the default remote cache manager with the default settings. * * @return the default remote cache manager. * @see org.infinispan.client.hotrod.RemoteCacheManager#RemoteCacheManager() */ @Produces @ApplicationScoped @DefaultBean(RemoteCacheManager.class) public RemoteCacheManager getDefaultRemoteCacheManager() { return new RemoteCacheManager(); }
/** * The default remote cache manager producer. This producer will override the default remote cache manager producer * provided by the CDI extension. */ @Produces @ApplicationScoped public RemoteCacheManager defaultRemoteCacheManager() { final Properties properties = new Properties(); properties.put(SERVER_LIST_KEY, SERVER_LIST_VALUE); return new RemoteCacheManager(properties); } }
protected void initialize(String login, String password) { Configuration config = getRemoteCacheManagerConfig(login, password); remoteCacheManager = new RemoteCacheManager(config, true); remoteCache = remoteCacheManager.getCache(TEST_CACHE_NAME); }
protected void initializeOverSsl(String login, String password) { Configuration config = getRemoteCacheManagerOverSslConfig(login, password); remoteCacheManager = new RemoteCacheManager(config, true); remoteCache = remoteCacheManager.getCache(TEST_CACHE_NAME); }
public static RemoteCacheManager createNoAuth(InetAddress ip, int port) { ConfigurationBuilder clientBuilder = new ConfigurationBuilder(); clientBuilder = withIpAndPort(clientBuilder, ip, port); clientBuilder = withSingleConnection(clientBuilder); return new RemoteCacheManager(clientBuilder.build()); }
public InfinispanConfiguration build() { ConfigurationBuilder builder = new ConfigurationBuilder(); if (this.infinispanConfiguration.getConfigurationProperties() != null) builder.withProperties(this.infinispanConfiguration.getConfigurationProperties()); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(builder.build()); BasicCache<Object, Object> basicCache = this.infinispanConfiguration.getCacheName() == null ? remoteCacheManager.getCache() : remoteCacheManager.getCache(this.infinispanConfiguration.getCacheName()); this.infinispanConfiguration.setCache(basicCache); return this.infinispanConfiguration; }
public InfinispanConfiguration build() { ConfigurationBuilder builder = new ConfigurationBuilder(); if (this.infinispanConfiguration.getConfigurationProperties() != null) builder.withProperties(this.infinispanConfiguration.getConfigurationProperties()); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(builder.build()); BasicCache<Object, Object> basicCache = this.infinispanConfiguration.getCacheName() == null ? remoteCacheManager.getCache() : remoteCacheManager.getCache(this.infinispanConfiguration.getCacheName()); this.infinispanConfiguration.setCache(basicCache); return this.infinispanConfiguration; }
@BeforeClass public void setupRemoteCacheFactory() { hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19733); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
@BeforeClass public void setupRemoteCacheFactory() { hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19733); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
@Before public void prepareAdminRCM() { if (adminRCM == null) { SecurityConfigurationHelper config = new SecurityConfigurationHelper("DIGEST-MD5"); config.forIspnServer(server1).withServerName("node0"); config.forCredentials(ADMIN_LOGIN, ADMIN_PASSWD); adminRCM = new RemoteCacheManager(config.build(), true); } }
@BeforeClass public void beforeClass() { org.infinispan.configuration.cache.ConfigurationBuilder cacheConfiguration = new org.infinispan.configuration.cache.ConfigurationBuilder(); embeddedCacheManager = TestCacheManagerFactory.createCacheManager(cacheConfiguration); hotrodServer = HotRodTestingUtil.startHotRodServer(embeddedCacheManager, 19723); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
@Override protected RemoteCacheManager createRemoteCacheManager() throws IOException { return new RemoteCacheManager(new org.infinispan.client.hotrod.configuration.ConfigurationBuilder() .addServer().host("localhost").port(hotRodServer.getPort()) .build()); }
@Before public void setUp() throws Exception { Configuration conf = new ConfigurationBuilder().addServer().host(server2.getHotrodEndpoint().getInetAddress().getHostName()).port(server2 .getHotrodEndpoint().getPort()).build(); cache = new RemoteCacheManager(conf).getCache(); }
@Test public void shouldPassWithAuth() throws Exception { SecurityConfigurationHelper config = new SecurityConfigurationHelper("DIGEST-MD5"); config.forIspnServer(server).withServerName("node0"); config.forCredentials(EXECUTOR_LOGIN, EXECUTOR_PASSWORD); RemoteCacheManager rcm = new RemoteCacheManager(config.build(), true); RemoteCache remoteCache = rcm.getCache(LocalAuthTestServerTask.CACHE_NAME); String result = (String) remoteCache.execute(LocalAuthTestServerTask.NAME, Collections.emptyMap()); assertEquals(LocalAuthTestServerTask.EXECUTED_VALUE, result); assertEquals(true, remoteCache.get(LocalAuthTestServerTask.KEY)); }
@Test public void testViaDirectConfig() throws Exception { ConfigurationBuilder builder = new ConfigurationBuilder(); String hostname = ispnServer.getHotrodEndpoint().getInetAddress().getHostName(); builder.addServer().host(hostname).port(ispnServer.getHotrodEndpoint().getPort()); builder.security().ssl().enable().trustStoreFileName(DEFAULT_TRUSTSTORE_PATH).trustStorePassword(DEFAULT_TRUSTSTORE_PASSWORD.toCharArray()); remoteCacheManager = new RemoteCacheManager(builder.build()); remoteCache = remoteCacheManager.getCache(RemoteCacheManager.DEFAULT_CACHE_NAME); testPutGet(remoteCache); testSize(remoteCache); }
@Test public void testAuthorizedAccessThroughSni() throws Exception { ConfigurationBuilder builder = new SecurityConfigurationHelper().withDefaultSsl().withSni("sni"); String hostname = ispnServer.getHotrodEndpoint().getInetAddress().getHostName(); builder.addServer().host(hostname).port(ispnServer.getHotrodEndpoint().getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); remoteCache = remoteCacheManager.getCache(RemoteCacheManager.DEFAULT_CACHE_NAME); assertNotNull(remoteCache); } }
@Before public void init() { ConfigurationBuilder builder = new SecurityConfigurationHelper().withDefaultSsl().withSni("sni1"); //FIXME: Use Infinispan Arquillian support after implementing https://issues.jboss.org/browse/ARQ-2035 builder.addServer().host("127.0.0.1").port(11222); remoteCacheManager = new RemoteCacheManager(builder.build()); remoteCache = remoteCacheManager.getCache(CACHE_NAME); rest = new RESTHelper(); rest.addServer("127.0.0.1", 8080, "/rest/multi-tenancy-1"); }
public void initRCM() { controller.start(ARQ_NODE_1_ID); final SecurityConfigurationHelper cb = new SecurityConfigurationHelper(SASL_MECH).forIspnServer(server1).withServerName(TEST_SERVER_NAME).withDefaultSsl(); cb.security().ssl().keyAlias("client1"); rcm = new RemoteCacheManager(cb.forExternalAuth().build(), true); controller.stop(ARQ_NODE_1_ID); isInitialized = true; }
@Override protected void setup() throws Exception { super.setup(); hotrodServer = HotRodClientTestingUtil.startHotRodServer(cacheManager); port = hotrodServer.getPort(); remoteCacheManager = new RemoteCacheManager( new org.infinispan.client.hotrod.configuration.ConfigurationBuilder().addServer().host("localhost").port(port).build()); remoteCacheManager.start(); GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(cacheManager); interpreter = gcr.getComponent(Interpreter.class); }