Java Code Examples for io.grpc.reflection.v1alpha.ExtensionRequest#getExtensionNumber()

The following examples show how to use io.grpc.reflection.v1alpha.ExtensionRequest#getExtensionNumber() . These examples are extracted from open source projects. 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
private void getFileByExtension(ServerReflectionRequest request) {
  ExtensionRequest extensionRequest = request.getFileContainingExtension();
  String type = extensionRequest.getContainingType();
  int extension = extensionRequest.getExtensionNumber();
  FileDescriptor fd =
      serverReflectionIndex.getFileDescriptorByExtensionAndNumber(type, extension);
  if (fd != null) {
    serverCallStreamObserver.onNext(createServerReflectionResponse(request, fd));
  } else {
    sendErrorResponse(request, Status.Code.NOT_FOUND, "Extension not found.");
  }
}
 
Example 2
Source Project: quarkus   File: ReflectionService.java    License: Apache License 2.0 5 votes vote down vote up
private ServerReflectionResponse getFileByExtension(ServerReflectionRequest request) {
    ExtensionRequest extensionRequest = request.getFileContainingExtension();
    String type = extensionRequest.getContainingType();
    int extension = extensionRequest.getExtensionNumber();
    FileDescriptor fd = index.getFileDescriptorByExtensionAndNumber(type, extension);
    if (fd != null) {
        return getServerReflectionResponse(request, fd);
    } else {
        return getErrorResponse(request, Status.Code.NOT_FOUND,
                "Extension not found (" + type + ", " + extension + ")");
    }
}
 
Example 3
private void getFileByExtension(ServerReflectionRequest request) {
  ExtensionRequest extensionRequest = request.getFileContainingExtension();
  String type = extensionRequest.getContainingType();
  int extension = extensionRequest.getExtensionNumber();
  FileDescriptor fd =
      serverReflectionIndex.getFileDescriptorByExtensionAndNumber(type, extension);
  if (fd != null) {
    serverCallStreamObserver.onNext(createServerReflectionResponse(request, fd));
  } else {
    sendErrorResponse(request, Status.Code.NOT_FOUND, "Extension not found.");
  }
}