Search in sources :

Example 1 with UmsClientConfig

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;
}
Also used : Field(java.lang.reflect.Field) GrpcUmsClient(com.sequenceiq.cloudbreak.auth.altus.GrpcUmsClient) UmsClientConfig(com.sequenceiq.cloudbreak.auth.altus.config.UmsClientConfig)

Aggregations

GrpcUmsClient (com.sequenceiq.cloudbreak.auth.altus.GrpcUmsClient)1 UmsClientConfig (com.sequenceiq.cloudbreak.auth.altus.config.UmsClientConfig)1 Field (java.lang.reflect.Field)1