Package org.rasdaman.rasnet.util
Class GrpcUtils
- java.lang.Object
-
- org.rasdaman.rasnet.util.GrpcUtils
-
public class GrpcUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description GrpcUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.RuntimeExceptionconvertStatusToRuntimeException(io.grpc.Status status)static booleanisServerAlive(org.rasdaman.rasnet.service.HealthServiceGrpc.HealthServiceBlockingStub healthService, int timeoutMilliseconds)Utility function used to check if the server is alive.
-
-
-
Method Detail
-
convertStatusToRuntimeException
public static java.lang.RuntimeException convertStatusToRuntimeException(io.grpc.Status status)
-
isServerAlive
public static boolean isServerAlive(org.rasdaman.rasnet.service.HealthServiceGrpc.HealthServiceBlockingStub healthService, int timeoutMilliseconds)Utility function used to check if the server is alive.- Parameters:
healthService- Initialized HealthServiceGrpc.HealthServiceBlockingStub connected to the server.timeoutMilliseconds- The number of milliseconds for which the client will wait for a reply from the server before declaring it unresponsive and returning false.- Returns:
- TRUE if the server responds with a valid message within the given timeout, FALSE otherwise.
-
-