public final class BidiStreamingMethodStubBuilderImpl<ReqT,RespT> extends Object implements BidiStreamingMethodStubBuilderStep<ReqT,RespT>, NextBidiStreamingMethodStubBuilderStep<ReqT,RespT>
| Constructor and Description |
|---|
BidiStreamingMethodStubBuilderImpl(io.grpc.MethodDescriptor<ReqT,RespT> method) |
| Modifier and Type | Method and Description |
|---|---|
MethodStub<ReqT,RespT> |
build() |
NextBidiStreamingMethodStubBuilderStep<ReqT,RespT> |
nextWillProxyTo(Function<io.grpc.stub.StreamObserver<RespT>,io.grpc.stub.StreamObserver<ReqT>> streamRequestResponseProxy)
Defines a proxying response, which will proxy the request to given
Response for
subsequent request call to this stub. |
NextBidiStreamingMethodStubBuilderStep<ReqT,RespT> |
willProxyTo(Function<io.grpc.stub.StreamObserver<RespT>,io.grpc.stub.StreamObserver<ReqT>> streamRequestResponseProxy)
Defines a proxying response, which will proxy the request to given
Response. |
BidiStreamingMethodStubBuilderStep<ReqT,RespT> |
withFirstRequest(Predicate<ReqT> requestPredicate)
Adds a request matcher for the stub, which will trigger only if incoming first request
satisfies given
Predicate. |
<T> BidiStreamingMethodStubBuilderStep<ReqT,RespT> |
withHeader(io.grpc.Metadata.Key<T> headerKey,
Predicate<T> predicate)
Adds a header matcher for the stub, which will trigger only if the given header
has value satisfying given
Predicate. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithHeader, withHeader, withHeader, withHeader, withoutHeader, withoutHeaderwithFirstRequestpublic <T> BidiStreamingMethodStubBuilderStep<ReqT,RespT> withHeader(@Nonnull io.grpc.Metadata.Key<T> headerKey, @Nonnull Predicate<T> predicate)
HeadersMatcherBuilderStepAdds a header matcher for the stub, which will trigger only if the given header
has value satisfying given Predicate.
Subsequent matchers for the same header will replace the old one.
withHeader in interface HeadersMatcherBuilderStep<BidiStreamingMethodStubBuilderStep<ReqT,RespT>>public BidiStreamingMethodStubBuilderStep<ReqT,RespT> withFirstRequest(@Nonnull Predicate<ReqT> requestPredicate)
FirstRequestMatcherBuilderStepAdds a request matcher for the stub, which will trigger only if incoming first request
satisfies given Predicate.
This is used for client or bidi streaming method calls. Only the first request can be used for matching, as a stub needs to be selected at this point or the call will be rejected.
Subsequent request matchers will replace the old one.
withFirstRequest in interface FirstRequestMatcherBuilderStep<BidiStreamingMethodStubBuilderStep<ReqT,RespT>,ReqT>public NextBidiStreamingMethodStubBuilderStep<ReqT,RespT> willProxyTo(@Nonnull Function<io.grpc.stub.StreamObserver<RespT>,io.grpc.stub.StreamObserver<ReqT>> streamRequestResponseProxy)
StreamRequestProxyResponseBuilderStepDefines a proxying response, which will proxy the request to given Response. The
user is responsible that the request is completed correctly.
Should be used when there needs to be more logic in the response method than returning a
simple response.
For example:
.willProxyTo((responseObserver) -> new StreamObserver
willProxyTo in interface StreamRequestProxyResponseBuilderStep<NextBidiStreamingMethodStubBuilderStep<ReqT,RespT>,ReqT,RespT>public NextBidiStreamingMethodStubBuilderStep<ReqT,RespT> nextWillProxyTo(@Nonnull Function<io.grpc.stub.StreamObserver<RespT>,io.grpc.stub.StreamObserver<ReqT>> streamRequestResponseProxy)
NextStreamRequestProxyResponseBuilderStepDefines a proxying response, which will proxy the request to given Response for
subsequent request call to this stub. The user is responsible that the request is completed correctly.
Should be used when there needs to be more logic in the response method than returning a
simple response.
For example:
.nextWillProxyTo((responseObserver) -> new StreamObserver
nextWillProxyTo in interface NextStreamRequestProxyResponseBuilderStep<NextBidiStreamingMethodStubBuilderStep<ReqT,RespT>,ReqT,RespT>public MethodStub<ReqT,RespT> build()
build in interface MethodStubBuilder<ReqT,RespT>Copyright © 2023. All rights reserved.