Package io.servicetalk.grpc.api
Class DefaultGrpcClientMetadata
- java.lang.Object
-
- io.servicetalk.grpc.api.DefaultGrpcClientMetadata
-
- All Implemented Interfaces:
GrpcClientMetadata
,GrpcMetadata
public class DefaultGrpcClientMetadata extends java.lang.Object implements GrpcClientMetadata
Default implementation forDefaultGrpcClientMetadata
.
-
-
Field Summary
-
Fields inherited from interface io.servicetalk.grpc.api.GrpcClientMetadata
GRPC_MAX_TIMEOUT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultGrpcClientMetadata(java.lang.String path)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.protected
DefaultGrpcClientMetadata(java.lang.String path, ContentCodec requestEncoding)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.protected
DefaultGrpcClientMetadata(java.lang.String path, ContentCodec requestEncoding, java.time.Duration timeout)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.protected
DefaultGrpcClientMetadata(java.lang.String path, GrpcExecutionStrategy strategy)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.protected
DefaultGrpcClientMetadata(java.lang.String path, GrpcExecutionStrategy strategy, ContentCodec requestEncoding)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.protected
DefaultGrpcClientMetadata(java.lang.String path, GrpcExecutionStrategy strategy, ContentCodec requestEncoding, java.time.Duration timeout)
Creates a new instance which uses the provided path, execution strategy, content codec, and timeout.protected
DefaultGrpcClientMetadata(java.lang.String path, GrpcExecutionStrategy strategy, java.time.Duration timeout)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.protected
DefaultGrpcClientMetadata(java.lang.String path, java.time.Duration timeout)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
path()
Returns the path for the associated gRPC method.ContentCodec
requestEncoding()
ContentCodec
to use for the associated gRPC method.GrpcExecutionStrategy
strategy()
GrpcExecutionStrategy
to use for the associated gRPC method.java.time.Duration
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
-
-
-
-
Constructor Detail
-
DefaultGrpcClientMetadata
protected DefaultGrpcClientMetadata(java.lang.String path)
Creates a new instance using provided parameters and defaults forDefaultGrpcClientMetadata(String, GrpcExecutionStrategy, ContentCodec, Duration)
.- Parameters:
path
- for the associated gRPC method.
-
DefaultGrpcClientMetadata
protected DefaultGrpcClientMetadata(java.lang.String path, ContentCodec requestEncoding)
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
protected DefaultGrpcClientMetadata(java.lang.String path, ContentCodec requestEncoding, java.time.Duration timeout)
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
protected DefaultGrpcClientMetadata(java.lang.String path, @Nullable GrpcExecutionStrategy strategy)
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
protected DefaultGrpcClientMetadata(java.lang.String path, @Nullable GrpcExecutionStrategy strategy, ContentCodec requestEncoding)
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
protected DefaultGrpcClientMetadata(java.lang.String path, @Nullable java.time.Duration timeout)
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
protected DefaultGrpcClientMetadata(java.lang.String path, @Nullable GrpcExecutionStrategy strategy, @Nullable java.time.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
protected DefaultGrpcClientMetadata(java.lang.String path, @Nullable GrpcExecutionStrategy strategy, ContentCodec requestEncoding, @Nullable java.time.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.
-
-
Method Detail
-
strategy
public final GrpcExecutionStrategy 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
public ContentCodec requestEncoding()
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.
-
timeout
@Nullable public java.time.Duration 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:
- gRPC Deadlines
-
path
public java.lang.String path()
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.
-
-