Java Code Examples for io.grpc.reflection.v1alpha.ServerReflectionRequest#getAllExtensionNumbersOfType()
The following examples show how to use
io.grpc.reflection.v1alpha.ServerReflectionRequest#getAllExtensionNumbersOfType() .
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 | 6 votes |
private void getAllExtensions(ServerReflectionRequest request) { String type = request.getAllExtensionNumbersOfType(); Set<Integer> extensions = serverReflectionIndex.getExtensionNumbersOfType(type); if (extensions != null) { ExtensionNumberResponse.Builder builder = ExtensionNumberResponse.newBuilder() .setBaseTypeName(type) .addAllExtensionNumber(extensions); serverCallStreamObserver.onNext( ServerReflectionResponse.newBuilder() .setValidHost(request.getHost()) .setOriginalRequest(request) .setAllExtensionNumbersResponse(builder) .build()); } else { sendErrorResponse(request, Status.Code.NOT_FOUND, "Type not found."); } }
Example 2
Source File: ReflectionService.java From quarkus with Apache License 2.0 | 6 votes |
private ServerReflectionResponse getAllExtensions(ServerReflectionRequest request) { String type = request.getAllExtensionNumbersOfType(); Set<Integer> extensions = index.getExtensionNumbersOfType(type); if (extensions != null) { ExtensionNumberResponse.Builder builder = ExtensionNumberResponse.newBuilder() .setBaseTypeName(type) .addAllExtensionNumber(extensions); return ServerReflectionResponse.newBuilder() .setValidHost(request.getHost()) .setOriginalRequest(request) .setAllExtensionNumbersResponse(builder) .build(); } else { return getErrorResponse(request, Status.Code.NOT_FOUND, "Type not found."); } }
Example 3
Source File: ProtoReflectionService.java From grpc-java with Apache License 2.0 | 6 votes |
private void getAllExtensions(ServerReflectionRequest request) { String type = request.getAllExtensionNumbersOfType(); Set<Integer> extensions = serverReflectionIndex.getExtensionNumbersOfType(type); if (extensions != null) { ExtensionNumberResponse.Builder builder = ExtensionNumberResponse.newBuilder() .setBaseTypeName(type) .addAllExtensionNumber(extensions); serverCallStreamObserver.onNext( ServerReflectionResponse.newBuilder() .setValidHost(request.getHost()) .setOriginalRequest(request) .setAllExtensionNumbersResponse(builder) .build()); } else { sendErrorResponse(request, Status.Code.NOT_FOUND, "Type not found."); } }