use of com.sequenceiq.cloudbreak.domain.ExposedServices in project cloudbreak by hortonworks.
the class ClusterHostServiceRunner method saveGatewayPillar.
private void saveGatewayPillar(GatewayConfig gatewayConfig, Cluster cluster, Map<String, SaltPillarProperties> servicePillar) throws IOException {
Map<String, Object> gateway = new HashMap<>();
gateway.put("address", gatewayConfig.getPublicAddress());
gateway.put("username", cluster.getUserName());
gateway.put("password", cluster.getPassword());
gateway.put("path", cluster.getGateway().getPath());
gateway.put("topology", cluster.getGateway().getTopologyName());
gateway.put("ssotype", cluster.getGateway().getSsoType());
gateway.put("ssoprovider", cluster.getGateway().getSsoProvider());
gateway.put("signpub", cluster.getGateway().getSignPub());
gateway.put("signcert", cluster.getGateway().getSignCert());
gateway.put("signkey", cluster.getGateway().getSignKey());
gateway.put("tokencert", cluster.getGateway().getTokenCert());
gateway.put("mastersecret", cluster.getStack().getSecurityConfig().getKnoxMasterSecret());
gateway.put("kerberos", cluster.isSecure());
Json exposedJson = cluster.getGateway().getExposedServices();
if (exposedJson != null && StringUtils.isNoneEmpty(exposedJson.getValue())) {
List<String> exposedServices = exposedJson.get(ExposedServices.class).getServices();
if (blueprintProcessorFactory.get(cluster.getBlueprint().getBlueprintText()).componentExistsInBlueprint("HIVE_SERVER_INTERACTIVE")) {
exposedServices = exposedServices.stream().map(x -> "HIVE".equals(x) ? "HIVE_INTERACTIVE" : x).collect(Collectors.toList());
}
gateway.put("exposed", exposedServices);
} else {
gateway.put("exposed", new ArrayList<>());
}
Map<String, List<String>> serviceLocation = componentLocator.getComponentLocation(cluster, new HashSet<>(ExposedService.getAllServiceName()));
gateway.put("location", serviceLocation);
servicePillar.put("gateway", new SaltPillarProperties("/gateway/init.sls", singletonMap("gateway", gateway)));
}
Aggregations