Interface AnyRpcServerContext


public interface AnyRpcServerContext
RPC-agnostic server-side RPC context.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    void
    finishWithResponse(com.google.protobuf.MessageLite response)
    Indicates that the RPC was handled successfully.
    long
    Returns a trace id for this request.
    long
    Returns 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

      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.