Package io.servicetalk.grpc.api
Class DefaultGrpcClientMetadata
java.lang.Object
io.servicetalk.grpc.api.DefaultGrpcClientMetadata
- All Implemented Interfaces:
GrpcClientMetadata
,GrpcMetadata
- Direct Known Subclasses:
Health.CheckMetadata
,Health.WatchMetadata
Default implementation for
DefaultGrpcClientMetadata
.-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionDefaultGrpcClientMetadata
(BufferEncoder requestEncoding) Creates a new instance.DefaultGrpcClientMetadata
(BufferEncoder requestEncoding, Duration timeout) Creates a new instance.protected
Create a new instance, by copying an existing instance.DefaultGrpcClientMetadata
(GrpcExecutionStrategy strategy, BufferEncoder requestEncoding) Create a new instance.DefaultGrpcClientMetadata
(GrpcExecutionStrategy strategy, BufferEncoder requestEncoding, Duration timeout) Create a new instance.protected
Deprecated.protected
DefaultGrpcClientMetadata
(String path, ContentCodec requestEncoding) Deprecated.protected
DefaultGrpcClientMetadata
(String path, ContentCodec requestEncoding, Duration timeout) Deprecated.protected
DefaultGrpcClientMetadata
(String path, GrpcClientMetadata rhs) Deprecated.protected
DefaultGrpcClientMetadata
(String path, GrpcExecutionStrategy strategy) Deprecated.protected
DefaultGrpcClientMetadata
(String path, GrpcExecutionStrategy strategy, ContentCodec requestEncoding) Deprecated.protected
DefaultGrpcClientMetadata
(String path, GrpcExecutionStrategy strategy, ContentCodec requestEncoding, Duration timeout) protected
DefaultGrpcClientMetadata
(String path, GrpcExecutionStrategy strategy, Duration timeout) protected
DefaultGrpcClientMetadata
(String path, Duration timeout) Deprecated.protected
DefaultGrpcClientMetadata
(String path, Supplier<ContextMap> requestContext, Supplier<ContextMap> responseContext, GrpcExecutionStrategy strategy, ContentCodec requestEncoding, Duration timeout) Deprecated.DefaultGrpcClientMetadata
(Duration timeout) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionpath()
Deprecated.Get theBufferEncoder
to use to compress the request associated with this object.A request context associated with thisGrpcMetadata
that translates intoHttpMetaData.context()
.Deprecated.A response context associated with thisGrpcMetadata
that translates intoHttpMetaData.context()
.final GrpcExecutionStrategy
strategy()
GrpcExecutionStrategy
to use for the associated gRPC method.timeout()
Returns timeout duration after which the response is no longer wanted.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.servicetalk.grpc.api.GrpcMetadata
path, requestContext, responseContext
-
Field Details
-
INSTANCE
Deprecated.UseDefaultGrpcClientMetadata()
to create a new instance instead.GrpcClientMetadata
contains modifiableGrpcMetadata.requestContext()
andGrpcMetadata.responseContext()
now. Using this constant there will be no access to the actual context and both mentioned methods will throwUnsupportedOperationException
.Constant with adefault characteristics
.
-
-
Constructor Details
-
DefaultGrpcClientMetadata
public DefaultGrpcClientMetadata() -
DefaultGrpcClientMetadata
Deprecated.Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.
-
DefaultGrpcClientMetadata
Deprecated.Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.requestEncoding
-ContentCodec
to use for the associated gRPC method.
-
DefaultGrpcClientMetadata
Creates a new instance.- Parameters:
requestEncoding
- Used to compress the request.
-
DefaultGrpcClientMetadata
Create a new instance.- Parameters:
timeout
- A timeout after which the response is no longer wanted.
-
DefaultGrpcClientMetadata
@Deprecated protected DefaultGrpcClientMetadata(String path, ContentCodec requestEncoding, Duration timeout) Deprecated.Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.requestEncoding
-ContentCodec
to use for the associated gRPC method.timeout
- A timeout after which the response is no longer wanted.
-
DefaultGrpcClientMetadata
Creates a new instance.- Parameters:
requestEncoding
- Used to compress the request.timeout
- A timeout after which the response is no longer wanted.
-
DefaultGrpcClientMetadata
@Deprecated protected DefaultGrpcClientMetadata(String path, @Nullable GrpcExecutionStrategy strategy) Deprecated.Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.strategy
-GrpcExecutionStrategy
to use for the associated gRPC method.
-
DefaultGrpcClientMetadata
@Deprecated protected DefaultGrpcClientMetadata(String path, @Nullable GrpcExecutionStrategy strategy, ContentCodec requestEncoding) Deprecated.Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.strategy
-GrpcExecutionStrategy
to use for the associated gRPC method.requestEncoding
-ContentCodec
to use for the associated gRPC method.
-
DefaultGrpcClientMetadata
public DefaultGrpcClientMetadata(@Nullable GrpcExecutionStrategy strategy, BufferEncoder requestEncoding) Create a new instance.- Parameters:
strategy
-GrpcExecutionStrategy
to use for the associated gRPC call.requestEncoding
- Used to compress the request.
-
DefaultGrpcClientMetadata
Deprecated.Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.timeout
- A timeout after which the response is no longer wanted.
-
DefaultGrpcClientMetadata
@Deprecated protected DefaultGrpcClientMetadata(String path, @Nullable GrpcExecutionStrategy strategy, @Nullable Duration timeout) Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.strategy
-GrpcExecutionStrategy
to use for the associated gRPC method.timeout
- A timeout after which the response is no longer wanted.
-
DefaultGrpcClientMetadata
@Deprecated protected DefaultGrpcClientMetadata(String path, @Nullable GrpcExecutionStrategy strategy, ContentCodec requestEncoding, @Nullable Duration timeout) Creates a new instance which uses the provided path, execution strategy, content codec, and timeout.- Parameters:
path
- for the associated gRPC method.strategy
-GrpcExecutionStrategy
to use for the associated gRPC method.requestEncoding
-ContentCodec
to use for the associated gRPC method.timeout
- A timeout after which the response is no longer wanted.
-
DefaultGrpcClientMetadata
@Deprecated protected DefaultGrpcClientMetadata(String path, Supplier<ContextMap> requestContext, Supplier<ContextMap> responseContext, @Nullable GrpcExecutionStrategy strategy, ContentCodec requestEncoding, @Nullable Duration timeout) Deprecated. -
DefaultGrpcClientMetadata
Deprecated.Create a new instance.- Parameters:
path
- for the associated gRPC method.rhs
- Copy everything except the path from this object.
-
DefaultGrpcClientMetadata
Create a new instance, by copying an existing instance.- Parameters:
rhs
- Right hand side to copy from.
-
DefaultGrpcClientMetadata
public DefaultGrpcClientMetadata(@Nullable GrpcExecutionStrategy strategy, @Nullable BufferEncoder requestEncoding, @Nullable Duration timeout) Create a new instance.- Parameters:
strategy
-GrpcExecutionStrategy
to use for the associated gRPC call.requestEncoding
- Used to compress the request.timeout
- A timeout after which the response is no longer wanted.
-
-
Method Details
-
strategy
Description copied from interface:GrpcClientMetadata
GrpcExecutionStrategy
to use for the associated gRPC method.- Specified by:
strategy
in interfaceGrpcClientMetadata
- Returns:
GrpcExecutionStrategy
to use for the associated gRPC method.
-
requestEncoding
Deprecated.Description copied from interface:GrpcClientMetadata
ContentCodec
to use for the associated gRPC method.- Specified by:
requestEncoding
in interfaceGrpcClientMetadata
- Returns:
ContentCodec
to use for the associated gRPC method.
-
requestCompressor
Description copied from interface:GrpcClientMetadata
Get theBufferEncoder
to use to compress the request associated with this object.- Specified by:
requestCompressor
in interfaceGrpcClientMetadata
- Returns:
- the
BufferEncoder
to use to compress the request associated with this object.
-
timeout
Description copied from interface:GrpcClientMetadata
Returns timeout duration after which the response is no longer wanted.- Specified by:
timeout
in interfaceGrpcClientMetadata
- Returns:
Duration
of associated timeout or null for no timeout- See Also:
-
path
Deprecated.Description copied from interface:GrpcMetadata
Returns the path for the associated gRPC method.- Specified by:
path
in interfaceGrpcMetadata
- Returns:
- The path for the associated gRPC method.
-
requestContext
Description copied from interface:GrpcMetadata
A request context associated with thisGrpcMetadata
that translates intoHttpMetaData.context()
.Context can be used to associate a state with a request without serializing its state on the wire or transmit a state between HTTP and gRPC layers.
- Specified by:
requestContext
in interfaceGrpcMetadata
- Returns:
- a request context associated with this
GrpcMetadata
that translates intoHttpMetaData.context()
.
-
responseContext
Description copied from interface:GrpcMetadata
A response context associated with thisGrpcMetadata
that translates intoHttpMetaData.context()
.Context can be used to associate a state with a response without serializing its state on the wire or transmit a state between HTTP and gRPC layers.
- Specified by:
responseContext
in interfaceGrpcMetadata
- Returns:
- a response context associated with this
GrpcMetadata
that translates intoHttpMetaData.context()
.
-
DefaultGrpcClientMetadata()
to create a new instance instead.