ElasticsearchConfig extends MapConfig { public Optional<String> getTransportHost() { return Optional.ofNullable(get(CONFIG_KEY_CLIENT_TRANSPORT_HOST)); } ElasticsearchConfig(String name, Config config); String getClientFactoryClassName(); Config getElasticseachSettings(); Optional<String> getIndexRequestFactoryClassName(); Optional<String> getTransportHost(); Optional<Integer> getTransportPort(); Optional<Integer> getBulkFlushMaxActions(); Optional<Integer> getBulkFlushMaxSizeMB(); Optional<Integer> getBulkFlushIntervalMS(); static final String CONFIG_KEY_CLIENT_FACTORY; static final String PREFIX_ELASTICSEARCH_SETTINGS; static final String CONFIG_KEY_INDEX_REQUEST_FACTORY; static final String CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS; static final String CONFIG_KEY_BULK_FLUSH_MAX_SIZE_MB; static final String CONFIG_KEY_BULK_FLUSH_INTERVALS_MS; static final String CONFIG_KEY_CLIENT_TRANSPORT_HOST; static final String CONFIG_KEY_CLIENT_TRANSPORT_PORT; }
@Test public void testGetTransportHost() throws Exception { assertFalse(EMPTY_CONFIG.getTransportHost().isPresent()); ElasticsearchConfig config = configForProperty("systems.es.client.transport.host", "example.org"); assertTrue(config.getTransportHost().isPresent()); assertEquals("example.org", config.getTransportHost().get()); }