All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.src.com.exactpro.th2.read.db.grpc.ReadDbDefaultAsyncImpl Maven / Gradle / Ivy

There is a newer version: 0.0.10-dev
Show newest version
package com.exactpro.th2.read.db.grpc;

import com.exactpro.th2.service.AbstractGrpcService;
import com.exactpro.th2.service.RetryPolicy;
import com.exactpro.th2.service.StubStorage;
import com.google.protobuf.Empty;
import io.grpc.CallOptions;
import io.grpc.Channel;
import io.grpc.stub.StreamObserver;
import java.lang.Override;
import java.lang.String;
import java.util.Map;

public class ReadDbDefaultAsyncImpl extends AbstractGrpcService implements AsyncReadDbService {
  public ReadDbDefaultAsyncImpl() {
    super();
  }

  public ReadDbDefaultAsyncImpl(RetryPolicy retryConfiguration,
      StubStorage serviceConfiguration) {
    super(retryConfiguration, serviceConfiguration);
  }

  public void execute(QueryRequest input, Map properties,
      StreamObserver observer) {
    com.exactpro.th2.read.db.grpc.ReadDbGrpc.ReadDbStub stub = getStub(input, properties);
    createAsyncRequest(observer, (newObserver) -> stub.execute(input, newObserver));
  }

  public void execute(QueryRequest input, StreamObserver observer) {
    execute(input, java.util.Collections.EMPTY_MAP, observer);
  }

  public void startPulling(DbPullRequest input, Map properties,
      StreamObserver observer) {
    com.exactpro.th2.read.db.grpc.ReadDbGrpc.ReadDbStub stub = getStub(input, properties);
    createAsyncRequest(observer, (newObserver) -> stub.startPulling(input, newObserver));
  }

  public void startPulling(DbPullRequest input, StreamObserver observer) {
    startPulling(input, java.util.Collections.EMPTY_MAP, observer);
  }

  public void stopPulling(StopPullingRequest input, Map properties,
      StreamObserver observer) {
    com.exactpro.th2.read.db.grpc.ReadDbGrpc.ReadDbStub stub = getStub(input, properties);
    createAsyncRequest(observer, (newObserver) -> stub.stopPulling(input, newObserver));
  }

  public void stopPulling(StopPullingRequest input, StreamObserver observer) {
    stopPulling(input, java.util.Collections.EMPTY_MAP, observer);
  }

  @Override
  protected ReadDbGrpc.ReadDbStub createStub(Channel channel, CallOptions callOptions) {
    return com.exactpro.th2.read.db.grpc.ReadDbGrpc.newStub(channel);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy