use of io.hops.hopsworks.common.dao.kafka.SharedProjectDTO in project hopsworks by logicalclocks.
the class TopicsBuilder method buildSharedProject.
public SharedProjectDTO buildSharedProject(UriInfo uriInfo, Project project, String topicName) {
SharedProjectDTO dto = new SharedProjectDTO();
dto.setHref(sharedProjectUri(uriInfo, project, topicName).build());
List<SharedProjectDTO> list = kafkaController.getTopicSharedProjects(topicName, project.getId());
dto.setCount(Integer.toUnsignedLong(list.size()));
list.forEach(dto::addItem);
return dto;
}
use of io.hops.hopsworks.common.dao.kafka.SharedProjectDTO in project hopsworks by logicalclocks.
the class KafkaController method getTopicSharedProjects.
public List<SharedProjectDTO> getTopicSharedProjects(String topicName, Integer ownerProjectId) {
List<SharedTopics> projectIds = sharedTopicsFacade.findSharedTopicsByTopicAndOwnerProject(topicName, ownerProjectId);
List<SharedProjectDTO> shareProjectDtos = new ArrayList<>();
for (SharedTopics st : projectIds) {
Project project = projectFacade.find(st.getSharedTopicsPK().getProjectId());
if (project != null) {
shareProjectDtos.add(new SharedProjectDTO(project.getName(), project.getId()));
}
}
return shareProjectDtos;
}
Aggregations