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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefaultGrpcClientMetadata(BufferEncoder requestEncoding) Creates a new instance.DefaultGrpcClientMetadata(BufferEncoder requestEncoding, Duration timeout) Creates a new instance.protectedCreate 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.protectedDeprecated.protectedDefaultGrpcClientMetadata(String path, ContentCodec requestEncoding) Deprecated.protectedDefaultGrpcClientMetadata(String path, ContentCodec requestEncoding, Duration timeout) Deprecated.protectedDefaultGrpcClientMetadata(String path, GrpcClientMetadata rhs) Deprecated.protectedDefaultGrpcClientMetadata(String path, GrpcExecutionStrategy strategy) Deprecated.protectedDefaultGrpcClientMetadata(String path, GrpcExecutionStrategy strategy, ContentCodec requestEncoding) Deprecated.protectedDefaultGrpcClientMetadata(String path, GrpcExecutionStrategy strategy, ContentCodec requestEncoding, Duration timeout) protectedDefaultGrpcClientMetadata(String path, GrpcExecutionStrategy strategy, Duration timeout) protectedDefaultGrpcClientMetadata(String path, Duration timeout) Deprecated.protectedDefaultGrpcClientMetadata(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 theBufferEncoderto use to compress the request associated with this object.A request context associated with thisGrpcMetadatathat translates intoHttpMetaData.context().Deprecated.A response context associated with thisGrpcMetadatathat translates intoHttpMetaData.context().final GrpcExecutionStrategystrategy()GrpcExecutionStrategyto 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, waitMethods inherited from interface io.servicetalk.grpc.api.GrpcMetadata
path, requestContext, responseContext
-
Field Details
-
INSTANCE
Deprecated.UseDefaultGrpcClientMetadata()to create a new instance instead.GrpcClientMetadatacontains 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-ContentCodecto 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-ContentCodecto 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-GrpcExecutionStrategyto 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-GrpcExecutionStrategyto use for the associated gRPC method.requestEncoding-ContentCodecto use for the associated gRPC method.
-
DefaultGrpcClientMetadata
public DefaultGrpcClientMetadata(@Nullable GrpcExecutionStrategy strategy, BufferEncoder requestEncoding) Create a new instance.- Parameters:
strategy-GrpcExecutionStrategyto 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-GrpcExecutionStrategyto 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-GrpcExecutionStrategyto use for the associated gRPC method.requestEncoding-ContentCodecto 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-GrpcExecutionStrategyto 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:GrpcClientMetadataGrpcExecutionStrategyto use for the associated gRPC method.- Specified by:
strategyin interfaceGrpcClientMetadata- Returns:
GrpcExecutionStrategyto use for the associated gRPC method.
-
requestEncoding
Deprecated.Description copied from interface:GrpcClientMetadataContentCodecto use for the associated gRPC method.- Specified by:
requestEncodingin interfaceGrpcClientMetadata- Returns:
ContentCodecto use for the associated gRPC method.
-
requestCompressor
Description copied from interface:GrpcClientMetadataGet theBufferEncoderto use to compress the request associated with this object.- Specified by:
requestCompressorin interfaceGrpcClientMetadata- Returns:
- the
BufferEncoderto use to compress the request associated with this object.
-
timeout
Description copied from interface:GrpcClientMetadataReturns timeout duration after which the response is no longer wanted.- Specified by:
timeoutin interfaceGrpcClientMetadata- Returns:
Durationof associated timeout or null for no timeout- See Also:
-
path
Deprecated.Description copied from interface:GrpcMetadataReturns the path for the associated gRPC method.- Specified by:
pathin interfaceGrpcMetadata- Returns:
- The path for the associated gRPC method.
-
requestContext
Description copied from interface:GrpcMetadataA request context associated with thisGrpcMetadatathat 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:
requestContextin interfaceGrpcMetadata- Returns:
- a request context associated with this
GrpcMetadatathat translates intoHttpMetaData.context().
-
responseContext
Description copied from interface:GrpcMetadataA response context associated with thisGrpcMetadatathat 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:
responseContextin interfaceGrpcMetadata- Returns:
- a response context associated with this
GrpcMetadatathat translates intoHttpMetaData.context().
-
DefaultGrpcClientMetadata()to create a new instance instead.