Search in sources :

Example 6 with URLManager

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);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) HaServiceConfig(org.apache.knox.gateway.ha.provider.HaServiceConfig)

Example 7 with URLManager

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);
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) HaServiceConfig(org.apache.knox.gateway.ha.provider.HaServiceConfig) Test(org.junit.Test)

Example 8 with URLManager

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());
}
Also used : URLManager(org.apache.knox.gateway.ha.provider.URLManager) Test(org.junit.Test)

Aggregations

URLManager (org.apache.knox.gateway.ha.provider.URLManager)8 HaServiceConfig (org.apache.knox.gateway.ha.provider.HaServiceConfig)6 Test (org.junit.Test)6