Class GrpcHelper
java.lang.Object
io.helidon.grpc.core.GrpcHelper
Helper methods for common gRPC tasks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ThrowableensureStatusException(Throwable thrown, io.grpc.Status status) static io.grpc.StatusRuntimeExceptionensureStatusRuntimeException(Throwable thrown, io.grpc.Status status) Ensure that aThrowableis aStatusRuntimeException.static StringextractMethodName(String fullMethodName) Extract the gRPC method name from a method full name.static StringextractNamePrefix(String fullMethodName) Extract the name prefix from a method full name.static StringextractServiceName(String fullMethodName) Extract the gRPC service name from a method full name.static StatustoHttpResponseStatus(io.grpc.Status status) Convert a gRPCStatusto aStatus.static StatustoHttpResponseStatus(io.grpc.StatusException ex) Convert a gRPCStatusExceptionto aStatus.static StatustoHttpResponseStatus(io.grpc.StatusRuntimeException ex) Convert a gRPCStatusRuntimeExceptionto aStatus.
-
Method Details
-
extractServiceName
-
extractNamePrefix
Extract the name prefix from a method full name.The prefix is everything upto the but not including the last '/' character in the full name.
- Parameters:
fullMethodName- the gRPC method full name- Returns:
- the name prefix extracted from the full name
-
extractMethodName
-
toHttpResponseStatus
-
toHttpResponseStatus
-
toHttpResponseStatus
-
ensureStatusException
-
ensureStatusRuntimeException
-