Package io.grpc.okhttp
Class OkHttpChannelProvider
- java.lang.Object
-
- io.grpc.ManagedChannelProvider
-
- io.grpc.okhttp.OkHttpChannelProvider
-
@Internal public final class OkHttpChannelProvider extends ManagedChannelProvider
Provider forOkHttpChannelBuilderinstances.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.ManagedChannelProvider
ManagedChannelProvider.NewChannelBuilderResult, ManagedChannelProvider.ProviderNotFoundException
-
-
Constructor Summary
Constructors Constructor Description OkHttpChannelProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OkHttpChannelBuilderbuilderForAddress(java.lang.String name, int port)Creates a new builder with the given host and port.OkHttpChannelBuilderbuilderForTarget(java.lang.String target)Creates a new builder with the given target URI.protected java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>>getSupportedSocketAddressTypes()Returns theSocketAddresstypes this ManagedChannelProvider supports.booleanisAvailable()Whether this provider is available for use, taking the current environment into consideration.ManagedChannelProvider.NewChannelBuilderResultnewChannelBuilder(java.lang.String target, ChannelCredentials creds)Creates a new builder with the given target URI and credentials.intpriority()A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.-
Methods inherited from class io.grpc.ManagedChannelProvider
provider
-
-
-
-
Method Detail
-
isAvailable
public boolean isAvailable()
Description copied from class:ManagedChannelProviderWhether this provider is available for use, taking the current environment into consideration. Iffalse, no other methods are safe to be called.- Specified by:
isAvailablein classManagedChannelProvider
-
priority
public int priority()
Description copied from class:ManagedChannelProviderA priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
priorityin classManagedChannelProvider
-
builderForAddress
public OkHttpChannelBuilder builderForAddress(java.lang.String name, int port)
Description copied from class:ManagedChannelProviderCreates a new builder with the given host and port.- Specified by:
builderForAddressin classManagedChannelProvider
-
builderForTarget
public OkHttpChannelBuilder builderForTarget(java.lang.String target)
Description copied from class:ManagedChannelProviderCreates a new builder with the given target URI.- Specified by:
builderForTargetin classManagedChannelProvider
-
newChannelBuilder
public ManagedChannelProvider.NewChannelBuilderResult newChannelBuilder(java.lang.String target, ChannelCredentials creds)
Description copied from class:ManagedChannelProviderCreates a new builder with the given target URI and credentials. Returns an error-string result if unable to understand the credentials.- Overrides:
newChannelBuilderin classManagedChannelProvider
-
getSupportedSocketAddressTypes
protected java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> getSupportedSocketAddressTypes()
Description copied from class:ManagedChannelProviderReturns theSocketAddresstypes this ManagedChannelProvider supports.- Specified by:
getSupportedSocketAddressTypesin classManagedChannelProvider
-
-