use of com.sequenceiq.freeipa.client.FreeIpaClientBuilder in project cloudbreak by hortonworks.
the class FreeIpaClientFactory method getFreeIpaClientBuilderForClusterProxy.
private FreeIpaClientBuilder getFreeIpaClientBuilderForClusterProxy(Stack stack, Optional<String> freeIpaFqdn) throws Exception {
HttpClientConfig httpClientConfig = new HttpClientConfig(clusterProxyConfiguration.getClusterProxyHost());
FreeIpa freeIpa = freeIpaService.findByStack(stack);
String clusterProxyPath = toClusterProxyBasepath(stack, freeIpaFqdn);
Map<String, String> additionalHeadersStickySessionFirstRpc = new HashMap<>();
Map<String, String> additionalHeadersStickySession = new HashMap<>();
Optional<String> stickyIdHeader = Optional.empty();
if (freeIpaFqdn.isEmpty()) {
additionalHeadersStickySessionFirstRpc.putAll(ADDITIONAL_CLUSTER_PROXY_HEADER_STICKY_SESSION_FIRST_RPC);
additionalHeadersStickySession.putAll(ADDITIONAL_CLUSTER_PROXY_HEADER_STICKY_SESSION);
stickyIdHeader = Optional.of(ADDITIONAL_CLUSTER_PROXY_HEADER_STICKY_SESSION_ID);
}
String freeIpaFqdnForClient = freeIpaFqdn.orElseGet(() -> FreeIpaDomainUtils.getFreeIpaFqdn(freeIpa.getDomain()));
if (useLegacyClusterProxyRegistration(stack)) {
clusterProxyPath = toLegacyClusterProxyBasepath(stack);
}
return new FreeIpaClientBuilder(ADMIN_USER, freeIpa.getAdminPassword(), httpClientConfig, freeIpaFqdnForClient, clusterProxyConfiguration.getClusterProxyPort(), clusterProxyPath, ADDITIONAL_CLUSTER_PROXY_HEADERS, additionalHeadersStickySessionFirstRpc, additionalHeadersStickySession, stickyIdHeader, CLUSTER_PROXY_ERROR_LISTENER, tracer);
}
use of com.sequenceiq.freeipa.client.FreeIpaClientBuilder in project cloudbreak by hortonworks.
the class FreeIpaClientFactory method getFreeIpaClientBuilderForDirectMode.
private FreeIpaClientBuilder getFreeIpaClientBuilderForDirectMode(Stack stack, InstanceMetaData instanceMetaData) throws Exception {
HttpClientConfig httpClientConfig = tlsSecurityService.buildTLSClientConfig(stack, instanceMetaData.getPublicIpWrapper(), instanceMetaData);
FreeIpa freeIpa = freeIpaService.findByStack(stack);
int gatewayPort = Optional.ofNullable(stack.getGatewayport()).orElse(ServiceFamilies.GATEWAY.getDefaultPort());
return new FreeIpaClientBuilder(ADMIN_USER, freeIpa.getAdminPassword(), httpClientConfig, gatewayPort, instanceMetaData.getDiscoveryFQDN(), tracer);
}
Aggregations