public final class ClientStreamingMethodStubBuilderImpl<ReqT,RespT> extends Object implements ClientStreamingMethodStubBuilderStep<ReqT,RespT>, NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>
| Constructor and Description |
|---|
ClientStreamingMethodStubBuilderImpl(io.grpc.MethodDescriptor<ReqT,RespT> method) |
| Modifier and Type | Method and Description |
|---|---|
MethodStub<ReqT,RespT> |
build() |
NextClientStreamingMethodResponseBuilderStep<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. |
NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> |
nextWillReturn(ExceptionResponseActionBuilder response)
Defines a exception
Response for subsequent request call to this stub. |
NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> |
nextWillReturn(ObjectResponseActionBuilder<RespT> response)
Defines a single
Response for subsequent request call to this stub. |
NextClientStreamingMethodResponseBuilderStep<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. |
NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> |
willReturn(ExceptionResponseActionBuilder response)
Defines a exception
Response that will terminate the request. |
NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> |
willReturn(ObjectResponseActionBuilder<RespT> response)
Defines a single
Response that will be returned for the request and complete it. |
ClientStreamingMethodStubBuilderStep<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> ClientStreamingMethodStubBuilderStep<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, withoutHeaderwithFirstRequestwillReturn, willReturnnextWillReturn, nextWillReturnpublic <T> ClientStreamingMethodStubBuilderStep<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<ClientStreamingMethodStubBuilderStep<ReqT,RespT>>public ClientStreamingMethodStubBuilderStep<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<ClientStreamingMethodStubBuilderStep<ReqT,RespT>,ReqT>public NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> willReturn(@Nonnull ObjectResponseActionBuilder<RespT> response)
SingleResponseBuilderStepResponse that will be returned for the request and complete it.willReturn in interface SingleResponseBuilderStep<NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>,RespT>public NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> willReturn(@Nonnull ExceptionResponseActionBuilder response)
SingleResponseBuilderStepResponse that will terminate the request.willReturn in interface SingleResponseBuilderStep<NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>,RespT>public NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> nextWillReturn(@Nonnull ObjectResponseActionBuilder<RespT> response)
NextSingleResponseBuilderStepDefines a single Response for subsequent request call to this stub.
If there are more requests coming in to this stub than responses defined, the last response defined will be returned for those requests.
nextWillReturn in interface NextSingleResponseBuilderStep<NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextClientStreamingMethodResponseBuilderStep<ReqT,RespT> nextWillReturn(@Nonnull ExceptionResponseActionBuilder response)
NextSingleResponseBuilderStepDefines a exception Response for subsequent request call to this stub.
If there are more requests coming in to this stub than responses defined, the last response defined will be returned for those requests.
nextWillReturn in interface NextSingleResponseBuilderStep<NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextClientStreamingMethodResponseBuilderStep<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<NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextClientStreamingMethodResponseBuilderStep<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<NextClientStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public MethodStub<ReqT,RespT> build()
build in interface MethodStubBuilder<ReqT,RespT>Copyright © 2023. All rights reserved.