use of org.openkilda.store.model.LinkStoreConfigDto in project open-kilda by telstra.
the class FlowService method getAllStatus.
/**
* Gets the all status list.
*
* @return the all status list
*/
public Set<String> getAllStatus() {
LinkStoreConfigDto linkStoreConfigDto = storeService.getLinkStoreConfig();
boolean isLinkStoreConfig = linkStoreConfigDto.getUrls().isEmpty();
Status status = Status.INSTANCE;
if (!isLinkStoreConfig) {
if (CollectionUtil.isEmpty(status.getStatuses())) {
status.setStatuses(new HashSet<String>(flowStoreService.getAllStatus()));
}
} else {
LOGGER.info("Link store is not configured. ");
}
return status.getStatuses() != null ? status.getStatuses() : new HashSet<String>();
}
use of org.openkilda.store.model.LinkStoreConfigDto in project open-kilda by telstra.
the class StoreService method getLinkStoreConfig.
/**
* Gets the link store config.
*
* @return the link store config
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public LinkStoreConfigDto getLinkStoreConfig() {
LOGGER.info("Get link store configuration");
LinkStoreConfigDto linkStoreConfigDto = new LinkStoreConfigDto();
List<LinkStoreRequestUrlsEntity> linkStoreRequestUrlsEntitiesList = linkStoreRequestUrlsRepository.findAll();
Map<String, UrlDto> urls = new HashMap<String, UrlDto>();
for (LinkStoreRequestUrlsEntity linkStoreRequestUrlsEntity : linkStoreRequestUrlsEntitiesList) {
urls.put(linkStoreRequestUrlsEntity.getUrlEntity().getName(), UrlConverter.toUrlDto(linkStoreRequestUrlsEntity.getUrlEntity()));
}
linkStoreConfigDto.setUrls(urls);
return linkStoreConfigDto;
}
Aggregations