Interface AnyRpcServerContext
public interface AnyRpcServerContext
RPC-agnostic server-side RPC context.
-
Method Summary
Modifier and TypeMethodDescriptionvoidfinishWithAppError(int appErrorCode, String errorDetail) Indicates that the RPC was handled in a way that means an "application error" should be signaled to the client.voidfinishWithResponse(com.google.protobuf.MessageLite response) Indicates that the RPC was handled successfully.longReturns a trace id for this request.longReturns the time at which the RPC began, in milliseconds since midnight UTC on 1970-01-01.Returns the remaining time for this call.
-
Method Details
-
finishWithResponse
void finishWithResponse(com.google.protobuf.MessageLite response) Indicates that the RPC was handled successfully. Here "successfully" means that a normal RPC response will be sent to the client. That response might still indicate an error. -
finishWithAppError
Indicates that the RPC was handled in a way that means an "application error" should be signaled to the client. If the RPC layer is Stubby, this means the application error is communicated by Stubby itself. -
getTimeRemaining
Duration getTimeRemaining()Returns the remaining time for this call. This value decreases while the call is being handled. -
getGlobalId
long getGlobalId()Returns a trace id for this request. Ideally provided by the RPC client so that the request is tied to the client's trace span. -
getStartTimeMillis
long getStartTimeMillis()Returns the time at which the RPC began, in milliseconds since midnight UTC on 1970-01-01.
-