@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/4901") public abstract class CallCredentials2 extends Object implements CallCredentials
CallCredentials
.
THIS CLASS NAME IS TEMPORARY and is part of a migration. This class will BE DELETED as it
replaces CallCredentials
in short-term. THIS CLASS SHOULD ONLY BE REFERENCED BY
IMPLEMENTIONS. All consumers should still reference CallCredentials
.
Modifier and Type | Class and Description |
---|---|
static class |
CallCredentials2.MetadataApplier |
CallCredentials.RequestInfo
ATTR_AUTHORITY, ATTR_SECURITY_LEVEL
Constructor and Description |
---|
CallCredentials2() |
Modifier and Type | Method and Description |
---|---|
abstract void |
applyRequestMetadata(CallCredentials.RequestInfo requestInfo,
Executor appExecutor,
CallCredentials2.MetadataApplier applier)
Pass the credential data to the given
CallCredentials.MetadataApplier , which will
propagate it to the request metadata. |
void |
applyRequestMetadata(MethodDescriptor<?,?> method,
Attributes attrs,
Executor appExecutor,
CallCredentials.MetadataApplier applier)
Pass the credential data to the given
CallCredentials.MetadataApplier , which will propagate it to
the request metadata. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
thisUsesUnstableApi
@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/1914") public abstract void applyRequestMetadata(CallCredentials.RequestInfo requestInfo, Executor appExecutor, CallCredentials2.MetadataApplier applier)
CallCredentials.MetadataApplier
, which will
propagate it to the request metadata.
It is called for each individual RPC, within the Context
of the call, before the
stream is about to be created on a transport. Implementations should not block in this
method. If metadata is not immediately available, e.g., needs to be fetched from network, the
implementation may give the applier
to an asynchronous task which will eventually call
the applier
. The RPC proceeds only after the applier
is called.
requestInfo
- request-related informationappExecutor
- The application thread-pool. It is provided to the implementation in case it
needs to perform blocking operations.applier
- The outlet of the produced headers. It can be called either before or after this
method returns.public final void applyRequestMetadata(MethodDescriptor<?,?> method, Attributes attrs, Executor appExecutor, CallCredentials.MetadataApplier applier)
CallCredentials
CallCredentials.MetadataApplier
, which will propagate it to
the request metadata.
It is called for each individual RPC, within the Context
of the call, before the
stream is about to be created on a transport. Implementations should not block in this
method. If metadata is not immediately available, e.g., needs to be fetched from network, the
implementation may give the applier
to an asynchronous task which will eventually call
the applier
. The RPC proceeds only after the applier
is called.
applyRequestMetadata
in interface CallCredentials
method
- The method descriptor of this RPCattrs
- Additional attributes from the transport, along with the keys defined in this
interface (i.e. the ATTR_*
fields) which are guaranteed to be present.appExecutor
- The application thread-pool. It is provided to the implementation in case it
needs to perform blocking operations.applier
- The outlet of the produced headers. It can be called either before or after this
method returns.Copyright © 2018. All rights reserved.