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;
}
Aggregations