UpdateTokenInterceptor

public class UpdateTokenInterceptor
extends Object implements ClientInterceptor

java.lang.Object
com.android.tradefed.result.resultdb.UpdateTokenInterceptor


一个 gRPC 客户端拦截器,用于处理 ResultDB 更新令牌。

它会将当前更新令牌附加到传出请求,并从特定 RPC 的传入响应标头中提取任何新的更新令牌 。

摘要

公共构造函数

UpdateTokenInterceptor(Supplier<String> tokenSupplier, Consumer<String> tokenConsumer, String updateTokenRpc)

UpdateTokenInterceptor 的构造函数。

公共方法

<ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, Channel next)

公共构造函数

UpdateTokenInterceptor

public UpdateTokenInterceptor (Supplier<String> tokenSupplier, 
                Consumer<String> tokenConsumer, 
                String updateTokenRpc)

UpdateTokenInterceptor 的构造函数。

参数
tokenSupplier Supplier:用于获取当前更新令牌的提供程序。

tokenConsumer Consumer:用于在收到新令牌时设置更新令牌的消费者。

updateTokenRpc String:RPC 方法名称列表,这些方法可能会在标头中返回更新令牌。

公共方法

interceptCall

public ClientCall<ReqT, RespT> interceptCall (MethodDescriptor<ReqT, RespT> method, 
                CallOptions callOptions, 
                Channel next)

参数
method MethodDescriptor

callOptions CallOptions

next Channel

返回值
ClientCall<ReqT, RespT>