use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.
the class DefaultHaProvider method addHaService.
@Override
public void addHaService(String serviceName, List<String> urls) {
HaServiceConfig haServiceConfig = descriptor.getServiceConfig(serviceName);
URLManager manager = URLManagerLoader.loadURLManager(haServiceConfig);
manager.setURLs(urls);
haServices.put(serviceName, manager);
}
use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.
the class KafkaZookeeperURLManagerTest method testHBaseZookeeperURLManagerLoading.
@Test
public void testHBaseZookeeperURLManagerLoading() {
HaServiceConfig config = new DefaultHaServiceConfig("KAFKA");
config.setEnabled(true);
config.setZookeeperEnsemble(cluster.getConnectString());
URLManager manager = URLManagerLoader.loadURLManager(config);
Assert.assertNotNull(manager);
Assert.assertTrue(manager instanceof KafkaZookeeperURLManager);
}
use of org.apache.knox.gateway.ha.provider.URLManager in project knox by apache.
the class URLManagerLoaderTest method testURLManagerLoader.
@Test
public void testURLManagerLoader() {
DefaultHaServiceConfig serviceConfig = new DefaultHaServiceConfig("mock-test");
URLManager manager = URLManagerLoader.loadURLManager(serviceConfig);
Assert.assertNotNull(manager);
Assert.assertTrue(manager instanceof MockURLManager);
Assert.assertNotNull(((MockURLManager) manager).getConfig());
Assert.assertEquals("mock-test", ((MockURLManager) manager).getConfig().getServiceName());
}
Aggregations