use of org.openkilda.store.model.UrlDto in project open-kilda by telstra.
the class StoreService method getUrl.
/**
* Gets the url.
*
* @param storeType the store type
*
* @param url the url
*
* @return the url
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public UrlDto getUrl(final StoreType storeType, final Url url) {
LOGGER.info("Get urls for store type");
UrlDto urlDto = null;
if (storeType == StoreType.LINK_STORE) {
LinkStoreRequestUrlsEntity urlsEntity = linkStoreRequestUrlsRepository.findByUrlEntity_name(url.getName());
urlDto = UrlConverter.toUrlDto(urlsEntity.getUrlEntity());
}
if (storeType == StoreType.SWITCH_STORE) {
SwitchStoreRequestUrlsEntity urlsEntity = switchStoreRequestUrlsRepository.findByUrlEntity_name(url.getName());
urlDto = UrlConverter.toUrlDto(urlsEntity.getUrlEntity());
}
return urlDto;
}
use of org.openkilda.store.model.UrlDto in project open-kilda by telstra.
the class StoreService method getSwitchStoreConfig.
/**
* Gets the switch store config.
*
* @return the switch store config
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public SwitchStoreConfigDto getSwitchStoreConfig() {
LOGGER.info("Get switch store configuration");
SwitchStoreConfigDto switchStoreConfigDto = new SwitchStoreConfigDto();
List<SwitchStoreRequestUrlsEntity> switchStoreRequestUrlsEntitiesList = switchStoreRequestUrlsRepository.findAll();
Map<String, UrlDto> urls = new HashMap<String, UrlDto>();
for (SwitchStoreRequestUrlsEntity switchStoreRequestUrlsEntity : switchStoreRequestUrlsEntitiesList) {
urls.put(switchStoreRequestUrlsEntity.getUrlEntity().getName(), UrlConverter.toUrlDto(switchStoreRequestUrlsEntity.getUrlEntity()));
}
switchStoreConfigDto.setUrls(urls);
return switchStoreConfigDto;
}
Aggregations