/** * Get all {@link EntitySpec} from Core API. */ public Map<String, EntitySpec> getAllEntitySpecs() { try { ListEntitiesResponse response = blockingStub.listEntities(Empty.getDefaultInstance()); return response .getEntitiesList() .stream() .collect(Collectors.toMap(EntitySpec::getName, Function.identity())); } catch (StatusRuntimeException e) { log.error("GRPC error in getAllEntitySpecs: {}", e.getStatus()); throw new SpecRetrievalException("Unable to retrieve entity spec", e); } }
/** * Get all {@link EntitySpec} from Core API. * * @return map of entity id as key and {@link EntitySpec} as value. */ public Map<String, EntitySpec> getAllEntitySpecs() { try { ListEntitiesResponse response = blockingStub.listEntities(Empty.getDefaultInstance()); return response .getEntitiesList() .stream() .collect(Collectors.toMap(EntitySpec::getName, Function.identity())); } catch (StatusRuntimeException e) { log.error("GRPC error in getAllEntitySpecs: {}", e.getStatus()); throw new SpecRetrievalException("Unable to retrieve entity spec", e); } }