Search in sources :

Example 1 with DefaultAliasService

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()));
}
Also used : Field(java.lang.reflect.Field) AliasService(org.apache.knox.gateway.services.security.AliasService) DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) Test(org.junit.Test)

Example 2 with DefaultAliasService

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);
}
Also used : DefaultKeystoreService(org.apache.knox.gateway.services.security.impl.DefaultKeystoreService) DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) DefaultTopologyService(org.apache.knox.gateway.services.topology.impl.DefaultTopologyService) RemoteConfigurationRegistryClientService(org.apache.knox.gateway.services.config.client.RemoteConfigurationRegistryClientService) DefaultCryptoService(org.apache.knox.gateway.services.security.impl.DefaultCryptoService) CLIMasterService(org.apache.knox.gateway.services.security.impl.CLIMasterService)

Example 3 with DefaultAliasService

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();
}
Also used : DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) DefaultTopologyService(org.apache.knox.gateway.services.topology.impl.DefaultTopologyService) DefaultMetricsService(org.apache.knox.gateway.services.metrics.impl.DefaultMetricsService) RemoteConfigurationRegistryClientService(org.apache.knox.gateway.services.config.client.RemoteConfigurationRegistryClientService) JettySSLService(org.apache.knox.gateway.services.security.impl.JettySSLService) SSLService(org.apache.knox.gateway.services.security.SSLService)

Example 4 with DefaultAliasService

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();
}
Also used : DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) DefaultTopologyService(org.apache.knox.gateway.services.topology.impl.DefaultTopologyService)

Example 5 with DefaultAliasService

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();
}
Also used : DefaultAliasService(org.apache.knox.gateway.services.security.impl.DefaultAliasService) DefaultTopologyService(org.apache.knox.gateway.services.topology.impl.DefaultTopologyService)

Aggregations

DefaultAliasService (org.apache.knox.gateway.services.security.impl.DefaultAliasService)7 DefaultTopologyService (org.apache.knox.gateway.services.topology.impl.DefaultTopologyService)6 RemoteConfigurationRegistryClientService (org.apache.knox.gateway.services.config.client.RemoteConfigurationRegistryClientService)3 DefaultMetricsService (org.apache.knox.gateway.services.metrics.impl.DefaultMetricsService)3 JettySSLService (org.apache.knox.gateway.services.security.impl.JettySSLService)3 SSLService (org.apache.knox.gateway.services.security.SSLService)2 DefaultCryptoService (org.apache.knox.gateway.services.security.impl.DefaultCryptoService)2 DefaultKeystoreService (org.apache.knox.gateway.services.security.impl.DefaultKeystoreService)2 Field (java.lang.reflect.Field)1 DefaultHostMapperService (org.apache.knox.gateway.services.hostmap.impl.DefaultHostMapperService)1 DefaultServiceDefinitionRegistry (org.apache.knox.gateway.services.registry.impl.DefaultServiceDefinitionRegistry)1 DefaultServiceRegistryService (org.apache.knox.gateway.services.registry.impl.DefaultServiceRegistryService)1 AliasService (org.apache.knox.gateway.services.security.AliasService)1 CLIMasterService (org.apache.knox.gateway.services.security.impl.CLIMasterService)1 DefaultMasterService (org.apache.knox.gateway.services.security.impl.DefaultMasterService)1 DefaultTokenAuthorityService (org.apache.knox.gateway.services.token.impl.DefaultTokenAuthorityService)1 DefaultClusterConfigurationMonitorService (org.apache.knox.gateway.services.topology.impl.DefaultClusterConfigurationMonitorService)1 Test (org.junit.Test)1