/** * Get all {@link FeatureSpec} available in Core API. */ public Map<String, FeatureSpec> getAllFeatureSpecs() { try { ListFeaturesResponse response = blockingStub.listFeatures(Empty.getDefaultInstance()); return response .getFeaturesList() .stream() .collect(Collectors.toMap(FeatureSpec::getId, Function.identity())); } catch (StatusRuntimeException e) { log.error("GRPC error in getAllFeatureSpecs, {}", e.getStatus()); throw new SpecRetrievalException("Unable to retrieve feature specs", e); } }
/** * Get all {@link FeatureSpec} available in Core API. * * @return map of feature id as key and {@link FeatureSpec} as value. */ public Map<String, FeatureSpec> getAllFeatureSpecs() { try { ListFeaturesResponse response = blockingStub.listFeatures(Empty.getDefaultInstance()); return response .getFeaturesList() .stream() .collect(Collectors.toMap(FeatureSpec::getId, Function.identity())); } catch (StatusRuntimeException e) { log.error("GRPC error in getAllFeatureSpecs, {}", e.getStatus()); throw new SpecRetrievalException("Unable to retrieve feature specs", e); } }