mirror of https://github.com/grpc/grpc-java.git
core: add getCallOptions() to CallCredentials.RequestInfo (#9538)
This is needed internally (b/134067789#comment20).
This commit is contained in:
parent
9853a0c463
commit
38b338228a
|
|
@ -91,6 +91,13 @@ public abstract class CallCredentials {
|
||||||
*/
|
*/
|
||||||
public abstract MethodDescriptor<?, ?> getMethodDescriptor();
|
public abstract MethodDescriptor<?, ?> getMethodDescriptor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The call options used to call this RPC.
|
||||||
|
*/
|
||||||
|
public CallOptions getCallOptions() {
|
||||||
|
throw new UnsupportedOperationException("Not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The security level on the transport.
|
* The security level on the transport.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,11 @@ final class CallCredentialsApplyingTransportFactory implements ClientTransportFa
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CallOptions getCallOptions() {
|
||||||
|
return callOptions;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SecurityLevel getSecurityLevel() {
|
public SecurityLevel getSecurityLevel() {
|
||||||
return firstNonNull(
|
return firstNonNull(
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ public class CallCredentialsApplyingTest {
|
||||||
RequestInfo info = infoCaptor.getValue();
|
RequestInfo info = infoCaptor.getValue();
|
||||||
assertSame(transportAttrs, info.getTransportAttrs());
|
assertSame(transportAttrs, info.getTransportAttrs());
|
||||||
assertSame(method, info.getMethodDescriptor());
|
assertSame(method, info.getMethodDescriptor());
|
||||||
|
assertSame(callOptions, info.getCallOptions());
|
||||||
assertSame(AUTHORITY, info.getAuthority());
|
assertSame(AUTHORITY, info.getAuthority());
|
||||||
assertSame(SecurityLevel.NONE, info.getSecurityLevel());
|
assertSame(SecurityLevel.NONE, info.getSecurityLevel());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue