Search in sources :

Example 1 with SwitchStoreConfigDto

use of org.openkilda.store.model.SwitchStoreConfigDto 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;
}
Also used : SwitchStoreConfigDto(org.openkilda.store.model.SwitchStoreConfigDto) UrlDto(org.openkilda.store.model.UrlDto) HashMap(java.util.HashMap) SwitchStoreRequestUrlsEntity(org.openkilda.store.switchstore.dao.entity.SwitchStoreRequestUrlsEntity) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

HashMap (java.util.HashMap)1 SwitchStoreConfigDto (org.openkilda.store.model.SwitchStoreConfigDto)1 UrlDto (org.openkilda.store.model.UrlDto)1 SwitchStoreRequestUrlsEntity (org.openkilda.store.switchstore.dao.entity.SwitchStoreRequestUrlsEntity)1 Transactional (org.springframework.transaction.annotation.Transactional)1