Search in sources :

Example 1 with SettingsKeyManagerConfigurationDTO

use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.SettingsKeyManagerConfigurationDTO in project carbon-apimgt by wso2.

the class SettingsMappingUtil method fromKeyManagerConfigurationToSettingsKeyManagerConfigurationDTO.

private static SettingsKeyManagerConfigurationDTO fromKeyManagerConfigurationToSettingsKeyManagerConfigurationDTO(String name, String displayName, String scopesClaim, String consumerKeyClaim, List<ConfigurationDto> connectionConfigurationDtoList, List<ConfigurationDto> endpointConfigurations) {
    SettingsKeyManagerConfigurationDTO settingsKeyManagerConfigurationDTO = new SettingsKeyManagerConfigurationDTO();
    settingsKeyManagerConfigurationDTO.setDisplayName(displayName);
    settingsKeyManagerConfigurationDTO.setType(name);
    settingsKeyManagerConfigurationDTO.setDefaultScopesClaim(scopesClaim);
    settingsKeyManagerConfigurationDTO.setDefaultConsumerKeyClaim(consumerKeyClaim);
    if (connectionConfigurationDtoList != null) {
        for (ConfigurationDto configurationDto : connectionConfigurationDtoList) {
            KeyManagerConfigurationDTO keyManagerConfigurationDTO = new KeyManagerConfigurationDTO();
            keyManagerConfigurationDTO.setName(configurationDto.getName());
            keyManagerConfigurationDTO.setLabel(configurationDto.getLabel());
            keyManagerConfigurationDTO.setType(configurationDto.getType());
            keyManagerConfigurationDTO.setRequired(configurationDto.isRequired());
            keyManagerConfigurationDTO.setMask(configurationDto.isMask());
            keyManagerConfigurationDTO.setMultiple(configurationDto.isMultiple());
            keyManagerConfigurationDTO.setTooltip(configurationDto.getTooltip());
            keyManagerConfigurationDTO.setDefault(configurationDto.getDefaultValue());
            keyManagerConfigurationDTO.setValues(configurationDto.getValues());
            settingsKeyManagerConfigurationDTO.getConfigurations().add(keyManagerConfigurationDTO);
        }
    }
    if (endpointConfigurations != null) {
        for (ConfigurationDto configurationDto : endpointConfigurations) {
            KeyManagerConfigurationDTO keyManagerConfigurationDTO = new KeyManagerConfigurationDTO();
            keyManagerConfigurationDTO.setName(configurationDto.getName());
            keyManagerConfigurationDTO.setLabel(configurationDto.getLabel());
            keyManagerConfigurationDTO.setType(configurationDto.getType());
            keyManagerConfigurationDTO.setRequired(configurationDto.isRequired());
            keyManagerConfigurationDTO.setMask(configurationDto.isMask());
            keyManagerConfigurationDTO.setMultiple(configurationDto.isMultiple());
            keyManagerConfigurationDTO.setTooltip(configurationDto.getTooltip());
            keyManagerConfigurationDTO.setDefault(configurationDto.getDefaultValue());
            keyManagerConfigurationDTO.setValues(configurationDto.getValues());
            settingsKeyManagerConfigurationDTO.getEndpointConfigurations().add(keyManagerConfigurationDTO);
        }
    }
    return settingsKeyManagerConfigurationDTO;
}
Also used : KeyManagerConfigurationDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerConfigurationDTO) SettingsKeyManagerConfigurationDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.SettingsKeyManagerConfigurationDTO) ConfigurationDto(org.wso2.carbon.apimgt.api.model.ConfigurationDto) SettingsKeyManagerConfigurationDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.SettingsKeyManagerConfigurationDTO)

Aggregations

ConfigurationDto (org.wso2.carbon.apimgt.api.model.ConfigurationDto)1 KeyManagerConfigurationDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerConfigurationDTO)1 SettingsKeyManagerConfigurationDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.SettingsKeyManagerConfigurationDTO)1