Modifier and Type | Class and Description |
---|---|
class |
Attributes
An immutable type-safe container of attributes.
|
class |
BinaryLog
A binary log that can be installed on a channel or server.
|
static class |
CallCredentials.MetadataApplier
The outlet of the produced headers.
|
static class |
CallCredentials.RequestInfo
The request-related information passed to
CallCredentials.applyRequestMetadata() . |
class |
ChannelLogger
A Channel-specific logger provided by GRPC library to
LoadBalancer implementations. |
class |
ClientStreamTracer
StreamTracer for the client-side. |
static class |
ClientStreamTracer.StreamInfo
Information about a stream.
|
interface |
Codec
Encloses classes related to the compression and decompression of messages.
|
class |
CompositeCallCredentials
Uses multiple
CallCredentials as if they were one. |
interface |
Compressor
Represents a message compressor.
|
class |
CompressorRegistry
Encloses classes related to the compression and decompression of messages.
|
class |
ConnectivityState
The connectivity states.
|
class |
ConnectivityStateInfo
A tuple of a
ConnectivityState and its associated Status . |
interface |
Decompressor
Represents a message decompressor.
|
class |
DecompressorRegistry
Encloses classes related to the compression and decompression of messages.
|
interface |
Detachable
An extension of
InputStream that allows the underlying data source to be detached and
transferred to a new instance of the same kind. |
class |
EquivalentAddressGroup
A group of
SocketAddress es that are considered equivalent when channel makes connections. |
static interface |
EquivalentAddressGroup.Attr
Annotation for
EquivalentAddressGroup 's attributes. |
class |
ForwardingChannelBuilder<T extends ForwardingChannelBuilder<T>>
A
ManagedChannelBuilder that delegates all its builder methods to another builder by
default. |
class |
ForwardingServerBuilder<T extends ServerBuilder<T>>
A
ServerBuilder that delegates all its builder methods to another builder by default. |
static interface |
Grpc.TransportAttr
Annotation for transport attributes.
|
interface |
HasByteBuffer
Extension to an
InputStream whose content can be accessed as ByteBuffer s. |
class |
HttpConnectProxiedSocketAddress
An
ProxiedSocketAddress for making a connection to an endpoint via an HTTP CONNECT proxy. |
class |
LoadBalancer
A pluggable component that receives resolved addresses from
NameResolver and provides the
channel a usable subchannel when asked. |
static class |
LoadBalancer.CreateSubchannelArgs
Arguments for creating a
LoadBalancer.Subchannel . |
static class |
LoadBalancer.CreateSubchannelArgs.Builder |
static class |
LoadBalancer.CreateSubchannelArgs.Key<T>
Key for a key-value pair.
|
static class |
LoadBalancer.Factory
Factory to create
LoadBalancer instance. |
static class |
LoadBalancer.Helper
Provides essentials for LoadBalancer implementations.
|
static class |
LoadBalancer.PickResult
A balancing decision made by
SubchannelPicker for an RPC. |
static class |
LoadBalancer.PickSubchannelArgs
Provides arguments for a
LoadBalancer.SubchannelPicker.pickSubchannel(
LoadBalancer.PickSubchannelArgs) . |
static class |
LoadBalancer.ResolvedAddresses
Represents a combination of the resolved server address, associated attributes and a load
balancing policy config.
|
static class |
LoadBalancer.ResolvedAddresses.Builder
Builder for
LoadBalancer.ResolvedAddresses . |
static class |
LoadBalancer.Subchannel
A logical connection to a server, or a group of equivalent servers represented by an
EquivalentAddressGroup . |
static class |
LoadBalancer.SubchannelPicker
The main balancing logic.
|
class |
LoadBalancerProvider
Provider of
LoadBalancer s. |
class |
LoadBalancerRegistry
Registry of
LoadBalancerProvider s. |
static interface |
Metadata.BinaryStreamMarshaller<T>
Marshaller for metadata values that are serialized to an InputStream.
|
static interface |
MethodDescriptor.PrototypeMarshaller<T>
A marshaller that uses a fixed instance of the type it produces.
|
static interface |
MethodDescriptor.ReflectableMarshaller<T>
A marshaller that supports retrieving it's type parameter
T at runtime. |
class |
NameResolver
A pluggable component that resolves a target
URI and return addresses to the caller. |
static class |
NameResolver.Args
Information that a
NameResolver.Factory uses to create a NameResolver . |
static class |
NameResolver.ConfigOrError
Represents either a successfully parsed service config, containing all necessary parts to be
later applied by the channel, or a Status containing the error encountered while parsing.
|
static class |
NameResolver.Factory
Factory that creates
NameResolver instances. |
static interface |
NameResolver.Listener
Receives address updates.
|
static class |
NameResolver.Listener2
Receives address updates.
|
static class |
NameResolver.ResolutionResult
Represents the results from a Name Resolver.
|
static class |
NameResolver.ResolutionResult.Builder
A builder for
NameResolver.ResolutionResult . |
static interface |
NameResolver.ResolutionResultAttr
Annotation for name resolution result attributes.
|
static class |
NameResolver.ServiceConfigParser
Parses and validates service configuration.
|
class |
NameResolverProvider
Provider of name resolvers for name agnostic consumption.
|
class |
NameResolverRegistry
Registry of
NameResolverProvider s. |
class |
ProxiedSocketAddress
An address that contains the information about making a connection via a proxy.
|
interface |
ProxyDetector
A utility class to detect which proxy, if any, should be used for a given
SocketAddress . |
class |
SecurityLevel
The level of security guarantee in communications.
|
interface |
ServerCallExecutorSupplier
Defines what executor handles the server call, based on each RPC call information at runtime.
|
class |
ServerStreamTracer
Listens to events on a stream to collect metrics.
|
class |
ServerTransportFilter
Listens on server transport life-cycle events, with the capability to read and/or change
transport attributes.
|
class |
StreamTracer
Listens to events on a stream to collect metrics.
|
class |
SynchronizationContext
A synchronization context is a queue of tasks that run in sequence.
|
Modifier and Type | Field and Description |
---|---|
static Attributes.Key<String> |
EquivalentAddressGroup.ATTR_AUTHORITY_OVERRIDE
The authority to be used when constructing Subchannels for this EquivalentAddressGroup.
|
static Attributes.Key<SocketAddress> |
Grpc.TRANSPORT_ATTR_LOCAL_ADDR
Attribute key for the local address of a transport.
|
static Attributes.Key<SocketAddress> |
Grpc.TRANSPORT_ATTR_REMOTE_ADDR
Attribute key for the remote address of a transport.
|
static Attributes.Key<SSLSession> |
Grpc.TRANSPORT_ATTR_SSL_SESSION
Attribute key for SSL session of a transport.
|
Modifier and Type | Method and Description |
---|---|
T |
ServerBuilder.addServices(List<ServerServiceDefinition> services)
Adds a list of service implementations to the handler registry together.
|
T |
ServerBuilder.addStreamTracerFactory(ServerStreamTracer.Factory factory)
Adds a
ServerStreamTracer.Factory to measure server-side traffic. |
T |
ServerBuilder.addTransportFilter(ServerTransportFilter filter)
Adds a
ServerTransportFilter . |
StatusRuntimeException |
Status.asRuntimeException(Metadata trailers)
Same as
Status.asRuntimeException() but includes the provided trailers in the returned
exception. |
T |
ServerBuilder.callExecutor(ServerCallExecutorSupplier executorSupplier)
Allows for defining a way to provide a custom executor to handle the server call.
|
abstract T |
ServerBuilder.compressorRegistry(CompressorRegistry registry)
Set the compression registry for use in the channel.
|
abstract T |
ManagedChannelBuilder.compressorRegistry(CompressorRegistry registry)
Set the compression registry for use in the channel.
|
abstract T |
ServerBuilder.decompressorRegistry(DecompressorRegistry registry)
Set the decompression registry for use in the channel.
|
abstract T |
ManagedChannelBuilder.decompressorRegistry(DecompressorRegistry registry)
Set the decompression registry for use in the channel.
|
T |
ManagedChannelBuilder.defaultLoadBalancingPolicy(String policy)
Sets the default load-balancing policy that will be used if the service config doesn't specify
one.
|
T |
ManagedChannelBuilder.defaultServiceConfig(Map<String,?> serviceConfig)
Provides a service config to the channel.
|
T |
ManagedChannelBuilder.disableServiceConfigLookUp()
Disables service config look-up from the naming system, which is enabled by default.
|
<T> Attributes.Builder |
Attributes.Builder.discard(Attributes.Key<T> key)
Removes the key and associated value from the attribtues.
|
<T> void |
Metadata.discardAll(Metadata.Key<T> key)
Remove all values for the given key without returning them.
|
T |
ManagedChannelBuilder.enableFullStreamDecompression()
Enables full-stream decompression of inbound streams.
|
void |
ManagedChannel.enterIdle()
Invoking this method moves the channel into the IDLE state and triggers tear-down of the
channel's name resolver and load balancer, while still allowing on-going RPCs on the channel to
continue.
|
static String |
MethodDescriptor.extractBareMethodName(String fullMethodName)
Extract the method name out of a fully qualified method name.
|
Set<String> |
DecompressorRegistry.getAdvertisedMessageEncodings()
Provides a list of all message encodings that have decompressors available and should be
advertised.
|
Attributes |
ServerCall.getAttributes()
Returns properties of a single call.
|
Attributes |
ClientCall.getAttributes()
Returns additional properties of the call.
|
String |
ServerCall.getAuthority()
Gets the authority this call is addressed to.
|
String |
CallOptions.getAuthority()
Override the HTTP/2 authority the channel claims to be connecting to.
|
String |
MethodDescriptor.getBareMethodName()
A convenience method for
extractBareMethodName(getFullMethodName()) . |
ChannelLogger |
NameResolver.Args.getChannelLogger()
Returns the
ChannelLogger for the Channel served by this NameResolver. |
String |
CallOptions.getCompressor()
Returns the compressor's name.
|
List<ServerServiceDefinition> |
Server.getImmutableServices()
Returns immutable services registered with the server, or an empty list if not supported by the
implementation.
|
List<? extends SocketAddress> |
Server.getListenSockets()
Returns a list of listening sockets for this server.
|
Integer |
CallOptions.getMaxInboundMessageSize()
Gets the maximum allowed message size acceptable from the remote peer.
|
Integer |
CallOptions.getMaxOutboundMessageSize()
Gets the maximum allowed message size acceptable to send the remote peer.
|
List<ServerServiceDefinition> |
Server.getMutableServices()
Returns mutable services registered with the server, or an empty list if not supported by the
implementation.
|
Executor |
NameResolver.Args.getOffloadExecutor()
Returns the Executor on which this resolver should execute long-running or I/O bound work.
|
<T> T |
CallOptions.getOption(CallOptions.Key<T> key)
Get the value for a custom option or its inherent default.
|
MethodDescriptor.Marshaller<ReqT> |
MethodDescriptor.getRequestMarshaller()
Returns the marshaller for the request type.
|
MethodDescriptor.Marshaller<RespT> |
MethodDescriptor.getResponseMarshaller()
Returns the marshaller for the response type.
|
ScheduledExecutorService |
NameResolver.Args.getScheduledExecutorService()
Returns a
ScheduledExecutorService for scheduling delayed tasks. |
Object |
ServiceDescriptor.getSchemaDescriptor()
Returns the schema descriptor for this service.
|
String |
MethodDescriptor.getServiceName()
A convenience method for
extractFullServiceName(getFullMethodName()) . |
List<ServerServiceDefinition> |
Server.getServices()
Returns all services registered with the server, or an empty list if not supported by the
implementation.
|
List<ServerServiceDefinition> |
HandlerRegistry.getServices()
Returns the
ServerServiceDefinition s provided by the registry, or an empty list if not
supported by the implementation. |
ConnectivityState |
ManagedChannel.getState(boolean requestConnection)
Gets the current connectivity state.
|
List<ClientStreamTracer.Factory> |
CallOptions.getStreamTracerFactories()
Returns an immutable list of
ClientStreamTracerFactory s. |
T |
ServerBuilder.handshakeTimeout(long timeout,
TimeUnit unit)
Sets the permitted time for new connections to complete negotiation handshakes before being
killed.
|
abstract T |
ManagedChannelBuilder.idleTimeout(long value,
TimeUnit unit)
Set the duration without ongoing RPCs before going to idle mode.
|
void |
LoadBalancer.Helper.ignoreRefreshNameResolutionCheck()
Historically the channel automatically refreshes name resolution if any subchannel
connection is broken.
|
T |
ServerBuilder.intercept(ServerInterceptor interceptor)
Adds a
ServerInterceptor that is run for all services on the server. |
T |
ManagedChannelBuilder.maxHedgedAttempts(int maxHedgedAttempts)
Sets the maximum number of hedged attempts that may be configured by the service config.
|
T |
ManagedChannelBuilder.maxRetryAttempts(int maxRetryAttempts)
Sets the maximum number of retry attempts that may be configured by the service config.
|
T |
ManagedChannelBuilder.maxTraceEvents(int maxTraceEvents)
Sets the maximum number of channel trace events to keep in the tracer for each channel or
subchannel.
|
abstract T |
ManagedChannelBuilder.nameResolverFactory(NameResolver.Factory resolverFactory)
Deprecated.
Most usages should use a globally-registered
NameResolverProvider instead,
with either the SPI mechanism or NameResolverRegistry.register(io.grpc.NameResolverProvider) . Replacements for
all use-cases are not necessarily available yet. See
#7133. |
void |
ManagedChannel.notifyWhenStateChanged(ConnectivityState source,
Runnable callback)
Registers a one-off callback that will be run if the connectivity state of the channel diverges
from the given
source , which is typically what has just been returned by ManagedChannel.getState(boolean) . |
static <T> Metadata.Key<T> |
Metadata.Key.of(String name,
Metadata.BinaryStreamMarshaller<T> marshaller)
Creates a key for a binary header, serializing to input streams.
|
static <T> CallOptions.Key<T> |
CallOptions.Key.of(String debugString,
T defaultValue)
Deprecated.
Use
CallOptions.Key.create(java.lang.String) or CallOptions.Key.createWithDefault(java.lang.String, T) instead. This method will
be removed. |
T |
ManagedChannelBuilder.offloadExecutor(Executor executor)
Provides a custom executor that will be used for operations that block or are expensive.
|
T |
ManagedChannelBuilder.perRpcBufferLimit(long bytes)
Sets the per RPC buffer limit in bytes used for retry.
|
T |
ManagedChannelBuilder.proxyDetector(ProxyDetector proxyDetector)
Sets the proxy detector to be used in addresses name resolution.
|
void |
ManagedChannel.resetConnectBackoff()
For subchannels that are in TRANSIENT_FAILURE state, short-circuit the backoff timer and make
them reconnect immediately.
|
T |
ManagedChannelBuilder.retryBufferSize(long bytes)
Sets the retry buffer size in bytes.
|
T |
ServerBuilder.setBinaryLog(BinaryLog binaryLog)
Sets the BinaryLog object that this server should log to.
|
T |
ManagedChannelBuilder.setBinaryLog(BinaryLog binaryLog)
Sets the BinaryLog object that this channel should log to.
|
NameResolver.Args.Builder |
NameResolver.Args.Builder.setChannelLogger(ChannelLogger channelLogger)
|
void |
ServerCall.setCompression(String compressor)
Sets the compression algorithm for this call.
|
void |
ServerCall.setMessageCompression(boolean enabled)
Enables per-message compression, if an encoding type has been negotiated.
|
void |
ClientCall.setMessageCompression(boolean enabled)
Enables per-message compression, if an encoding type has been negotiated.
|
ServiceDescriptor.Builder |
ServiceDescriptor.Builder.setName(String name)
Sets the name.
|
NameResolver.Args.Builder |
NameResolver.Args.Builder.setOffloadExecutor(Executor executor)
|
NameResolver.Args.Builder |
NameResolver.Args.Builder.setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
|
static Status |
Contexts.statusFromCancelled(io.grpc.Context context)
Returns the
Status of a cancelled context or null if the context
is not cancelled. |
abstract void |
CallCredentials.thisUsesUnstableApi()
Should be a noop but never called; tries to make it clearer to implementors that they may break
in the future.
|
static Metadata |
Status.trailersFromThrowable(Throwable t)
Extract an error trailers from the causal chain of a
Throwable . |
static ServerServiceDefinition |
ServerInterceptors.useInputStreamMessages(ServerServiceDefinition serviceDef)
Create a new
ServerServiceDefinition whose MethodDescriptor serializes to
and from InputStream for all methods. |
static <T> ServerServiceDefinition |
ServerInterceptors.useMarshalledMessages(ServerServiceDefinition serviceDef,
MethodDescriptor.Marshaller<T> marshaller)
Create a new
ServerServiceDefinition whose MethodDescriptor serializes to
and from T for all methods. |
T |
ManagedChannelBuilder.useTransportSecurity()
Makes the client use TLS.
|
CallOptions |
CallOptions.withAuthority(String authority)
Override the HTTP/2 authority the channel claims to be connecting to.
|
CallOptions |
CallOptions.withCompression(String compressorName)
Sets the compression to use for the call.
|
CallOptions |
CallOptions.withMaxInboundMessageSize(int maxSize)
Sets the maximum allowed message size acceptable from the remote peer.
|
CallOptions |
CallOptions.withMaxOutboundMessageSize(int maxSize)
Sets the maximum allowed message size acceptable sent to the remote peer.
|
CallOptions |
CallOptions.withStreamTracerFactory(ClientStreamTracer.Factory factory)
Returns a new
CallOptions with a ClientStreamTracerFactory in addition to
the existing factories. |