Class ExceptionTransformingUnaryCallable<RequestT,ResponseT>

java.lang.Object
com.google.api.gax.rpc.UnaryCallable<RequestT,ResponseT>
com.google.ads.googleads.lib.stubs.callables.ExceptionTransformingUnaryCallable<RequestT,ResponseT>

public class ExceptionTransformingUnaryCallable<RequestT,ResponseT> extends com.google.api.gax.rpc.UnaryCallable<RequestT,ResponseT>
Wrapper around a UnaryCallable which invokes an ExceptionTransformation for Throwables which occur on the stream.

NOTE: This class could be pushed into the gax library, as it is not specific to the Google Ads API.

  • Constructor Details

    • ExceptionTransformingUnaryCallable

      public ExceptionTransformingUnaryCallable(com.google.api.gax.rpc.UnaryCallable<RequestT,ResponseT> callable, ExceptionTransformation transformation, Executor transformationExecutor)
      Constructs a new instance. The transformationExecutor should be the executor for the callable's ClientContext.
      Parameters:
      callable - the Callable that may throw an exception.
      transformation - the transformation to perform on any thrown exceptions.
      transformationExecutor - the Executor to use to execute the transformation.
  • Method Details

    • futureCall

      public com.google.api.core.ApiFuture<ResponseT> futureCall(RequestT request, com.google.api.gax.rpc.ApiCallContext inputContext)
      Specified by:
      futureCall in class com.google.api.gax.rpc.UnaryCallable<RequestT,ResponseT>