/** * @param cipherSuites list of cipher suites * @param protocols list of protocols * @throws Exception If failed. */ private void checkSuccessfulClientStart(String[] cipherSuites, String[] protocols) throws Exception { this.cipherSuites = F.isEmpty(cipherSuites) ? null : cipherSuites; this.protocols = F.isEmpty(protocols) ? null : protocols; try (IgniteClient client = Ignition.startClient(getClientConfiguration())) { client.getOrCreateCache(TEST_CACHE_NAME); } }
IgniteClient client = Ignition.startClient(getClientConfiguration()) ) { ClientCache<Integer, Person> cache = client.getOrCreateCache(Config.DEFAULT_CACHE_NAME);
/** Test valid user authentication. */ @Test public void testValidUserAuthentication() throws Exception { final String USER = "joe"; final String PWD = "password"; try (Ignite ignored = igniteWithAuthentication(new SimpleEntry<>(USER, PWD)); IgniteClient client = Ignition.startClient(new ClientConfiguration().setAddresses(Config.SERVER) .setUserName(USER) .setUserPassword(PWD) ) ) { client.getOrCreateCache("testAuthentication"); } }
final Random rnd = new Random(); final ClientCache<Integer, String> cache = client.getOrCreateCache( new ClientCacheConfiguration().setName("testFailover").setCacheMode(CacheMode.REPLICATED) );
.setQueryEntities(qryPerson); ClientCache<Integer, BinaryObject> cache = client.getOrCreateCache(cacheCfg).withKeepBinary();
Person val = new Person(key, Integer.toString(key)); ClientCache<Integer, Person> cache = client.getOrCreateCache(cacheCfg);
/** Test valid user authentication. */ @Test public void testInvalidUserAuthentication() { Exception authError = null; try (Ignite ignored = igniteWithAuthentication(); IgniteClient client = Ignition.startClient(new ClientConfiguration().setAddresses(Config.SERVER) .setUserName("JOE") .setUserPassword("password") ) ) { client.getOrCreateCache("testAuthentication"); } catch (Exception e) { authError = e; } assertNotNull("Authentication with invalid credentials succeeded", authError); assertTrue("Invalid type of authentication error", authError instanceof ClientAuthenticationException); }
IgniteClient client = Ignition.startClient(getClientConfiguration()) ) { ClientCache<Integer, Person> cache = client.getOrCreateCache(Config.DEFAULT_CACHE_NAME); IgniteClient client = Ignition.startClient(getClientConfiguration()) ) { ClientCache<Person, Integer> cache = client.getOrCreateCache("testPutGet"); IgniteClient client = Ignition.startClient(getClientConfiguration()) ) { ClientCache<Person, Person> cache = client.getOrCreateCache("testPutGet");