use of org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasServiceProvider in project knox by apache.
the class AliasServiceFactory method createService.
@Override
protected Service createService(GatewayServices gatewayServices, ServiceType serviceType, GatewayConfig gatewayConfig, Map<String, String> options, String implementation) throws ServiceLifecycleException {
Service service = null;
if (shouldCreateService(implementation)) {
final AliasService defaultAliasService = new DefaultAliasService();
((DefaultAliasService) defaultAliasService).setMasterService(getMasterService(gatewayServices));
((DefaultAliasService) defaultAliasService).setKeystoreService(getKeystoreService(gatewayServices));
// invoking init on DefaultAliasService twice is ok (in case implementation is set to 'default')
defaultAliasService.init(gatewayConfig, options);
if (matchesImplementation(implementation, DefaultAliasService.class, true)) {
service = defaultAliasService;
} else if (matchesImplementation(implementation, HashicorpVaultAliasService.class)) {
service = new HashicorpVaultAliasService(defaultAliasService);
} else if (matchesImplementation(implementation, RemoteAliasService.class)) {
service = new RemoteAliasService(defaultAliasService, getMasterService(gatewayServices));
} else if (matchesImplementation(implementation, ZookeeperRemoteAliasService.class)) {
service = new ZookeeperRemoteAliasServiceProvider().newInstance(gatewayServices, defaultAliasService, getMasterService(gatewayServices));
}
logServiceUsage(implementation, serviceType);
}
return service;
}
Aggregations