Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add getCallOptions() to CallCredentials.RequestInfo #9538

Merged
merged 2 commits into from Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/src/main/java/io/grpc/CallCredentials.java
Expand Up @@ -91,6 +91,13 @@ public abstract static class RequestInfo {
*/
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.
*/
Expand Down
Expand Up @@ -127,6 +127,11 @@ public ClientStream newStream(
return method;
}

@Override
public CallOptions getCallOptions() {
return callOptions;
}

@Override
public SecurityLevel getSecurityLevel() {
return firstNonNull(
Expand Down
Expand Up @@ -148,6 +148,7 @@ public void parameterPropagation_base() {
RequestInfo info = infoCaptor.getValue();
assertSame(transportAttrs, info.getTransportAttrs());
assertSame(method, info.getMethodDescriptor());
assertSame(callOptions, info.getCallOptions());
assertSame(AUTHORITY, info.getAuthority());
assertSame(SecurityLevel.NONE, info.getSecurityLevel());
}
Expand Down