/** Constructs an instance of TraceServiceClient with default settings. */ public static final TraceServiceClient create() throws IOException { return create(TraceServiceSettings.newBuilder().build()); }
/** * Constructs an instance of TraceServiceClient, using the given settings. The channels are * created based on the settings passed in, or defaults for any settings that are not set. */ public static final TraceServiceClient create(TraceServiceSettings settings) throws IOException { return new TraceServiceClient(settings); }
@Override public TraceServiceSettings build() throws IOException { return new TraceServiceSettings(this); } }
@Before public void setUp() throws IOException { serviceHelper.reset(); channelProvider = serviceHelper.createChannelProvider(); TraceServiceSettings settings = TraceServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) .setCredentialsProvider(NoCredentialsProvider.create()) .build(); client = TraceServiceClient.create(settings); }
public static final TraceServiceSettings create(TraceServiceStubSettings stub) throws IOException { return new TraceServiceSettings.Builder(stub.toBuilder()).build(); }
/** Returns the builder for the settings used for calls to batchWriteSpans. */ public UnaryCallSettings.Builder<BatchWriteSpansRequest, Empty> batchWriteSpansSettings() { return getStubSettingsBuilder().batchWriteSpansSettings(); }
/** Returns the builder for the settings used for calls to createSpan. */ public UnaryCallSettings.Builder<Span, Span> createSpanSettings() { return getStubSettingsBuilder().createSpanSettings(); }
/** * Constructs an instance of TraceServiceClient, using the given settings. This is protected so * that it is easy to make a subclass, but otherwise, the static factory methods should be * preferred. */ protected TraceServiceClient(TraceServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((TraceServiceStubSettings) settings.getStubSettings()).createStub(); }
/** Returns the object with the settings used for calls to batchWriteSpans. */ public UnaryCallSettings<BatchWriteSpansRequest, Empty> batchWriteSpansSettings() { return ((TraceServiceStubSettings) getStubSettings()).batchWriteSpansSettings(); }
/** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); }
public TraceServiceStubSettings.Builder getStubSettingsBuilder() { return ((TraceServiceStubSettings.Builder) getStubSettings()); }
@Override public List<GeneratedMessageV3> getRequests() { return serviceImpl.getRequests(); }
@Override public void addResponse(GeneratedMessageV3 response) { serviceImpl.addResponse(response); }
@Override public void reset() { serviceImpl.reset(); } }
@Override public void addException(Exception exception) { serviceImpl.addException(exception); }
@Override public ServerServiceDefinition getServiceDefinition() { return serviceImpl.bindService(); }
public MockTraceService() { serviceImpl = new MockTraceServiceImpl(); }
@Test public void run() { main(null); }
/** * Constructs an instance of TraceServiceClient, using the given stub for making calls. This is * for advanced usage - prefer to use TraceServiceSettings}. */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final TraceServiceClient create(TraceServiceStub stub) { return new TraceServiceClient(stub); }
/** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); }