use of com.sequenceiq.cloudbreak.auth.altus.config.UmsClientConfig in project cloudbreak by hortonworks.
the class UmsClient method createProxyUmsClient.
public static synchronized UmsClient createProxyUmsClient(Tracer tracer, String umsHost) {
UmsClient clientEntity = new UmsClient();
UmsClientConfig clientConfig = new UmsClientConfig();
Field callingServiceName = ReflectionUtils.findField(UmsClientConfig.class, "callingServiceName");
ReflectionUtils.makeAccessible(callingServiceName);
ReflectionUtils.setField(callingServiceName, clientConfig, "cloudbreak");
Field grpcTimeoutSec = ReflectionUtils.findField(UmsClientConfig.class, "grpcTimeoutSec");
ReflectionUtils.makeAccessible(grpcTimeoutSec);
ReflectionUtils.setField(grpcTimeoutSec, clientConfig, 60L);
clientEntity.umsClient = GrpcUmsClient.createClient(UmsChannelConfig.newManagedChannelWrapper(umsHost, 8982), clientConfig, tracer);
return clientEntity;
}
Aggregations