private void listServices(ServerReflectionRequest request) { ListServiceResponse.Builder builder = ListServiceResponse.newBuilder(); for (String serviceName : serverReflectionIndex.getServiceNames()) { builder.addService(ServiceResponse.newBuilder().setName(serviceName)); } serverCallStreamObserver.onNext( ServerReflectionResponse.newBuilder() .setValidHost(request.getHost()) .setOriginalRequest(request) .setListServicesResponse(builder) .build()); }
private void handleListServiceRespones(ListServiceResponse response) { ImmutableList.Builder<String> servicesBuilder = ImmutableList.builder(); response.getServiceList().forEach(service -> servicesBuilder.add(service.getName())); resultFuture.set(servicesBuilder.build()); requestStream.onCompleted(); }