Top Description Inners Fields Constructors Methods
io.grpc

public final Class CompositeCallCredentials

extends CallCredentials
Class Inheritance
Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/1914
Imports
com.google.common.base.Preconditions, java.util.concurrent.Executor

Uses multiple CallCredentials as if they were one. If the first credential fails, the second will not be used. Both must succeed to allow the RPC.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class

Field Summary

Modifier and TypeField and Description
private final CallCredentials
private final CallCredentials

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
applyRequestMetadata(CallCredentials.RequestInfo
request-related information
requestInfo
,
Executor
The application thread-pool. It is provided to the implementation in case it needs to perform blocking operations.
appExecutor
,
CallCredentials.MetadataApplier
The outlet of the produced headers. It can be called either before or after this method returns.
applier
)

Implements abstract io.grpc.CallCredentials.applyRequestMetadata.

Pass the credential data to the given CallCredentials.MetadataApplier, which will propagate it to the request metadata.
Inherited from io.grpc.CallCredentials:
thisUsesUnstableApi

Field Detail

credentials1back to summary
private final CallCredentials credentials1
credentials2back to summary
private final CallCredentials credentials2

Constructor Detail

CompositeCallCredentialsback to summary
public CompositeCallCredentials(CallCredentials creds1, CallCredentials creds2)

Method Detail

applyRequestMetadataback to summary
public void applyRequestMetadata(CallCredentials.RequestInfo requestInfo, Executor appExecutor, CallCredentials.MetadataApplier applier)

Implements abstract io.grpc.CallCredentials.applyRequestMetadata.

Doc from io.grpc.CallCredentials.applyRequestMetadata.

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.

Parameters
requestInfo:CallCredentials.RequestInfo

request-related information

appExecutor:Executor

The application thread-pool. It is provided to the implementation in case it needs to perform blocking operations.

applier:CallCredentials.MetadataApplier

The outlet of the produced headers. It can be called either before or after this method returns.

Annotations
@Override
io.grpc back to summary

private final Class CompositeCallCredentials.CombiningMetadataApplier

extends MetadataApplier
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final CallCredentials.MetadataApplier
private final Metadata

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
apply(Metadata headers)

Implements abstract io.grpc.CallCredentials.MetadataApplier.apply.

Called when headers are successfully generated.
public void
fail(Status status)

Implements abstract io.grpc.CallCredentials.MetadataApplier.fail.

Called when there has been an error when preparing the headers.

Field Detail

delegateback to summary
private final CallCredentials.MetadataApplier delegate
firstHeadersback to summary
private final Metadata firstHeaders

Constructor Detail

CombiningMetadataApplierback to summary
public CombiningMetadataApplier(CallCredentials.MetadataApplier delegate, Metadata firstHeaders)

Method Detail

applyback to summary
public void apply(Metadata headers)

Implements abstract io.grpc.CallCredentials.MetadataApplier.apply.

Doc from io.grpc.CallCredentials.MetadataApplier.apply.

Called when headers are successfully generated. They will be merged into the original headers.

Annotations
@Override
failback to summary
public void fail(Status status)

Implements abstract io.grpc.CallCredentials.MetadataApplier.fail.

Doc from io.grpc.CallCredentials.MetadataApplier.fail.

Called when there has been an error when preparing the headers. This will fail the RPC.

Annotations
@Override
io.grpc back to summary

private final Class CompositeCallCredentials.WrappingMetadataApplier

extends MetadataApplier
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Executor
private final Context
private final CallCredentials.MetadataApplier
private final CallCredentials.RequestInfo

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
apply(Metadata headers)

Implements abstract io.grpc.CallCredentials.MetadataApplier.apply.

Called when headers are successfully generated.
public void
fail(Status status)

Implements abstract io.grpc.CallCredentials.MetadataApplier.fail.

Called when there has been an error when preparing the headers.

Field Detail

appExecutorback to summary
private final Executor appExecutor
contextback to summary
private final Context context
delegateback to summary
private final CallCredentials.MetadataApplier delegate
requestInfoback to summary
private final CallCredentials.RequestInfo requestInfo

Constructor Detail

WrappingMetadataApplierback to summary
public WrappingMetadataApplier(CallCredentials.RequestInfo requestInfo, Executor appExecutor, CallCredentials.MetadataApplier delegate, Context context)

Method Detail

applyback to summary
public void apply(Metadata headers)

Implements abstract io.grpc.CallCredentials.MetadataApplier.apply.

Doc from io.grpc.CallCredentials.MetadataApplier.apply.

Called when headers are successfully generated. They will be merged into the original headers.

Annotations
@Override
failback to summary
public void fail(Status status)

Implements abstract io.grpc.CallCredentials.MetadataApplier.fail.

Doc from io.grpc.CallCredentials.MetadataApplier.fail.

Called when there has been an error when preparing the headers. This will fail the RPC.

Annotations
@Override