Package io.grpc

Class CallCredentials2


  • @Deprecated
    @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4901")
    public abstract class CallCredentials2
    extends CallCredentials
    Deprecated.
    the new interface has been promoted into CallCredentials. Implementations should switch back to "extends CallCredentials".
    The new interface for 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 IS ONLY REFERENCED BY IMPLEMENTIONS. All consumers should be always referencing CallCredentials.

    • Constructor Detail

      • CallCredentials2

        public CallCredentials2()
        Deprecated.
    • Method Detail

      • applyRequestMetadata

        @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1914")
        public abstract void applyRequestMetadata​(CallCredentials.RequestInfo requestInfo,
                                                  java.util.concurrent.Executor appExecutor,
                                                  CallCredentials2.MetadataApplier applier)
        Deprecated.
        Pass the credential data to the given CallCredentials2.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.

        Parameters:
        requestInfo - request-related information
        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.
      • applyRequestMetadata

        public final void applyRequestMetadata​(CallCredentials.RequestInfo requestInfo,
                                               java.util.concurrent.Executor appExecutor,
                                               CallCredentials.MetadataApplier applier)
        Deprecated.
        Description copied from class: CallCredentials
        Pass the credential data to the given 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.

        Specified by:
        applyRequestMetadata in class CallCredentials
        Parameters:
        requestInfo - request-related information
        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.