use of org.apache.knox.gateway.services.security.impl.DefaultAliasService in project knox by apache.
the class ServiceDiscoveryFactoryTest method testGetPropertiesFileImplWithAliasServiceInjection.
@Test
public void testGetPropertiesFileImplWithAliasServiceInjection() throws Exception {
String TYPE = "PROPERTIES_FILE";
ServiceDiscovery sd = ServiceDiscoveryFactory.get(TYPE, new DefaultAliasService());
assertNotNull("Expected to get a ServiceDiscovery object.", sd);
assertEquals("Unexpected ServiceDiscovery type.", TYPE, sd.getType());
// Verify that the AliasService was injected as expected
Field aliasServiceField = sd.getClass().getDeclaredField("aliasService");
aliasServiceField.setAccessible(true);
Object fieldValue = aliasServiceField.get(sd);
assertNotNull(fieldValue);
assertTrue(AliasService.class.isAssignableFrom(fieldValue.getClass()));
}
use of org.apache.knox.gateway.services.security.impl.DefaultAliasService in project knox by apache.
the class CLIGatewayServices method init.
public void init(GatewayConfig config, Map<String, String> options) throws ServiceLifecycleException {
ms = new CLIMasterService();
ms.init(config, options);
services.put("MasterService", ms);
ks = new DefaultKeystoreService();
ks.setMasterService(ms);
ks.init(config, options);
services.put(KEYSTORE_SERVICE, ks);
DefaultAliasService alias = new DefaultAliasService();
alias.setKeystoreService(ks);
alias.init(config, options);
services.put(ALIAS_SERVICE, alias);
DefaultCryptoService crypto = new DefaultCryptoService();
crypto.setKeystoreService(ks);
crypto.setAliasService(alias);
crypto.init(config, options);
services.put(CRYPTO_SERVICE, crypto);
DefaultTopologyService tops = new DefaultTopologyService();
tops.init(config, options);
services.put(TOPOLOGY_SERVICE, tops);
RemoteConfigurationRegistryClientService registryClientService = RemoteConfigurationRegistryClientServiceFactory.newInstance(config);
registryClientService.setAliasService(alias);
registryClientService.init(config, options);
services.put(REMOTE_REGISTRY_CLIENT_SERVICE, registryClientService);
}
use of org.apache.knox.gateway.services.security.impl.DefaultAliasService in project knox by apache.
the class DefaultGatewayServices method start.
public void start() throws ServiceLifecycleException {
ms.start();
ks.start();
DefaultAliasService alias = (DefaultAliasService) services.get(ALIAS_SERVICE);
alias.start();
SSLService ssl = (SSLService) services.get(SSL_SERVICE);
ssl.start();
ServerInfoService sis = (ServerInfoService) services.get(SERVER_INFO_SERVICE);
sis.start();
RemoteConfigurationRegistryClientService clientService = (RemoteConfigurationRegistryClientService) services.get(REMOTE_REGISTRY_CLIENT_SERVICE);
clientService.start();
(services.get(CLUSTER_CONFIGURATION_MONITOR_SERVICE)).start();
DefaultTopologyService tops = (DefaultTopologyService) services.get(TOPOLOGY_SERVICE);
tops.start();
DefaultMetricsService metricsService = (DefaultMetricsService) services.get(METRICS_SERVICE);
metricsService.start();
}
use of org.apache.knox.gateway.services.security.impl.DefaultAliasService in project knox by apache.
the class CLIGatewayServices method stop.
public void stop() throws ServiceLifecycleException {
ms.stop();
ks.stop();
DefaultAliasService alias = (DefaultAliasService) services.get(ALIAS_SERVICE);
alias.stop();
DefaultTopologyService tops = (DefaultTopologyService) services.get(TOPOLOGY_SERVICE);
tops.stop();
}
use of org.apache.knox.gateway.services.security.impl.DefaultAliasService in project knox by apache.
the class CLIGatewayServices method start.
public void start() throws ServiceLifecycleException {
ms.start();
ks.start();
DefaultAliasService alias = (DefaultAliasService) services.get(ALIAS_SERVICE);
alias.start();
DefaultTopologyService tops = (DefaultTopologyService) services.get(TOPOLOGY_SERVICE);
tops.start();
(services.get(REMOTE_REGISTRY_CLIENT_SERVICE)).start();
}
Aggregations