Java Code Examples for io.grpc.reflection.v1alpha.ServerReflectionRequest#getFileContainingSymbol()

The following examples show how to use io.grpc.reflection.v1alpha.ServerReflectionRequest#getFileContainingSymbol() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProtoReflectionService.java    From grpc-nebula-java with Apache License 2.0 5 votes vote down vote up
private void getFileContainingSymbol(ServerReflectionRequest request) {
  String symbol = request.getFileContainingSymbol();
  FileDescriptor fd = serverReflectionIndex.getFileDescriptorBySymbol(symbol);
  if (fd != null) {
    serverCallStreamObserver.onNext(createServerReflectionResponse(request, fd));
  } else {
    sendErrorResponse(request, Status.Code.NOT_FOUND, "Symbol not found.");
  }
}
 
Example 2
Source File: ReflectionService.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private ServerReflectionResponse getFileContainingSymbol(ServerReflectionRequest request) {
    String symbol = request.getFileContainingSymbol();
    FileDescriptor fd = index.getFileDescriptorBySymbol(symbol);
    if (fd != null) {
        return getServerReflectionResponse(request, fd);
    } else {
        return getErrorResponse(request, Status.Code.NOT_FOUND, "Symbol not found (" + symbol + ")");
    }
}
 
Example 3
Source File: ProtoReflectionService.java    From grpc-java with Apache License 2.0 5 votes vote down vote up
private void getFileContainingSymbol(ServerReflectionRequest request) {
  String symbol = request.getFileContainingSymbol();
  FileDescriptor fd = serverReflectionIndex.getFileDescriptorBySymbol(symbol);
  if (fd != null) {
    serverCallStreamObserver.onNext(createServerReflectionResponse(request, fd));
  } else {
    sendErrorResponse(request, Status.Code.NOT_FOUND, "Symbol not found.");
  }
}