I - the request typeO - the response typepublic abstract class UserClient<I extends Request,O extends Response> extends AbstractUnwrappable<Client<I,O>> implements ClientBuilderParams
| Modifier | Constructor and Description |
|---|---|
protected |
UserClient(ClientBuilderParams params,
Client<I,O> delegate,
MeterRegistry meterRegistry,
SessionProtocol sessionProtocol,
Endpoint endpoint)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
clientType()
Returns the type of the client.
|
protected Endpoint |
endpoint()
Returns the
Endpoint of the AbstractUnwrappable.delegate(). |
protected O |
execute(io.netty.channel.EventLoop eventLoop,
Endpoint endpoint,
HttpMethod method,
String path,
String query,
String fragment,
I req,
BiFunction<ClientRequestContext,Throwable,O> fallback)
Executes the specified
Request via AbstractUnwrappable.delegate(). |
protected O |
execute(HttpMethod method,
String path,
String query,
String fragment,
I req,
BiFunction<ClientRequestContext,Throwable,O> fallback)
Executes the specified
Request via AbstractUnwrappable.delegate(). |
ClientFactory |
factory()
Returns the
ClientFactory who created the client. |
ClientOptions |
options()
Returns the options of the client.
|
protected SessionProtocol |
sessionProtocol()
Returns the
SessionProtocol of the AbstractUnwrappable.delegate(). |
URI |
uri()
Returns the endpoint URI of the client.
|
as, delegate, toStringprotected UserClient(ClientBuilderParams params, Client<I,O> delegate, MeterRegistry meterRegistry, SessionProtocol sessionProtocol, Endpoint endpoint)
params - the parameters used for constructing the clientdelegate - the Client that will process RequestsmeterRegistry - the MeterRegistry that collects various statssessionProtocol - the SessionProtocol of the Clientendpoint - the Endpoint of the Clientpublic ClientFactory factory()
ClientBuilderParamsClientFactory who created the client.factory in interface ClientBuilderParamspublic URI uri()
ClientBuilderParamsuri in interface ClientBuilderParamspublic Class<?> clientType()
ClientBuilderParamsclientType in interface ClientBuilderParamspublic final ClientOptions options()
ClientBuilderParamsoptions in interface ClientBuilderParamsprotected final SessionProtocol sessionProtocol()
SessionProtocol of the AbstractUnwrappable.delegate().protected final Endpoint endpoint()
Endpoint of the AbstractUnwrappable.delegate().protected final O execute(HttpMethod method, String path, @Nullable String query, @Nullable String fragment, I req, BiFunction<ClientRequestContext,Throwable,O> fallback)
Request via AbstractUnwrappable.delegate().method - the method of the Requestpath - the path part of the Request URIquery - the query part of the Request URIfragment - the fragment part of the Request URIreq - the Requestfallback - the fallback response BiFunction to use when
Client.execute(ClientRequestContext, Request) of AbstractUnwrappable.delegate() throws
an exception instead of returning an error responseprotected final O execute(@Nullable io.netty.channel.EventLoop eventLoop, Endpoint endpoint, HttpMethod method, String path, @Nullable String query, @Nullable String fragment, I req, BiFunction<ClientRequestContext,Throwable,O> fallback)
Request via AbstractUnwrappable.delegate().eventLoop - the EventLoop to execute the Requestendpoint - the Endpoint of the Requestmethod - the method of the Requestpath - the path part of the Request URIquery - the query part of the Request URIfragment - the fragment part of the Request URIreq - the Requestfallback - the fallback response BiFunction to use when
Client.execute(ClientRequestContext, Request) of AbstractUnwrappable.delegate() throwsCopyright © 2020 LeanCloud. All rights reserved.