Interface AnyRpcServerContext
-
public interface AnyRpcServerContextRPC-agnostic server-side RPC context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfinishWithAppError(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.longgetGlobalId()Returns a trace id for this request.longgetStartTimeMillis()Returns the time at which the RPC began, in milliseconds since midnight UTC on 1970-01-01.DurationgetTimeRemaining()Returns the remaining time for this call.
-
-
-
Method Detail
-
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
void finishWithAppError(int appErrorCode, String errorDetail)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.
-
-