use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO in project carbon-apimgt by wso2.
the class KeyManagerMappingUtil method toKeyManagerListDTO.
public static KeyManagerListDTO toKeyManagerListDTO(List<KeyManagerConfigurationDTO> keyManagerDTOList) {
KeyManagerListDTO keyManagerListDTO = new KeyManagerListDTO();
List<KeyManagerInfoDTO> keyManagerDTOS = new ArrayList<>();
for (KeyManagerConfigurationDTO keyManagerConfigurationDTO : keyManagerDTOList) {
keyManagerDTOS.add(toKeyManagerInfoDTO(keyManagerConfigurationDTO));
}
keyManagerListDTO.setList(keyManagerDTOS);
keyManagerListDTO.setCount(keyManagerDTOS.size());
return keyManagerListDTO;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO in project carbon-apimgt by wso2.
the class KeyManagerMappingUtil method toKeyManagerInfoDTO.
public static KeyManagerInfoDTO toKeyManagerInfoDTO(KeyManagerConfigurationDTO keyManagerConfigurationDTO) {
KeyManagerInfoDTO keyManagerInfoDTO = new KeyManagerInfoDTO();
keyManagerInfoDTO.setId(keyManagerConfigurationDTO.getUuid());
keyManagerInfoDTO.setName(keyManagerConfigurationDTO.getName());
keyManagerInfoDTO.setDescription(keyManagerConfigurationDTO.getDescription());
keyManagerInfoDTO.setType(keyManagerConfigurationDTO.getType());
keyManagerInfoDTO.setEnabled(keyManagerConfigurationDTO.isEnabled());
keyManagerInfoDTO.setTokenType(KeyManagerInfoDTO.TokenTypeEnum.fromValue(keyManagerConfigurationDTO.getTokenType()));
return keyManagerInfoDTO;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO in project carbon-apimgt by wso2.
the class KeyManagerMappingUtil method toKeyManagerListDto.
public static KeyManagerListDTO toKeyManagerListDto(List<KeyManagerConfigurationDTO> keyManagerConfigurations) {
KeyManagerListDTO keyManagerListDTO = new KeyManagerListDTO();
List<KeyManagerInfoDTO> keyManagerInfoDTOList = new ArrayList<>();
for (KeyManagerConfigurationDTO keyManagerConfigurationDTO : keyManagerConfigurations) {
keyManagerInfoDTOList.add(fromKeyManagerConfigurationDtoToKeyManagerInfoDto(keyManagerConfigurationDTO));
}
keyManagerListDTO.setList(keyManagerInfoDTOList);
keyManagerListDTO.setCount(keyManagerInfoDTOList.size());
return keyManagerListDTO;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO in project carbon-apimgt by wso2.
the class KeyManagerMappingUtil method fromKeyManagerConfigurationDtoToKeyManagerInfoDto.
private static KeyManagerInfoDTO fromKeyManagerConfigurationDtoToKeyManagerInfoDto(KeyManagerConfigurationDTO configurationDto) {
KeyManagerInfoDTO keyManagerInfoDTO = new KeyManagerInfoDTO();
keyManagerInfoDTO.setName(configurationDto.getName());
keyManagerInfoDTO.setDisplayName(configurationDto.getDisplayName());
keyManagerInfoDTO.setDescription(configurationDto.getDescription());
keyManagerInfoDTO.setId(configurationDto.getUuid());
keyManagerInfoDTO.setEnabled(configurationDto.isEnabled());
keyManagerInfoDTO.setType(configurationDto.getType());
return keyManagerInfoDTO;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO in project carbon-apimgt by wso2.
the class MappingUtil method toKeyManagerInfoDTO.
/**
* Converts RegistrationSummary key manager information into KeyManagerInfoDTO
*
* @param registrationSummary the registration summary required by gateway
* @return KeyManagerInfoDTO
*/
private static KeyManagerInfoDTO toKeyManagerInfoDTO(RegistrationSummary registrationSummary) {
KeyManagerInfoDTO keyManagerInfoDTO = new KeyManagerInfoDTO();
keyManagerInfoDTO.setDcrEndpoint(registrationSummary.getKeyManagerInfo().getDcrEndpoint());
keyManagerInfoDTO.setIntrospectEndpoint(registrationSummary.getKeyManagerInfo().getIntrospectEndpoint());
keyManagerInfoDTO.setRevokeEndpoint(registrationSummary.getKeyManagerInfo().getRevokeEndpoint());
keyManagerInfoDTO.setTokenEndpoint(registrationSummary.getKeyManagerInfo().getTokenEndpoint());
CredentialsDTO keyManagerCredentials = new CredentialsDTO();
keyManagerCredentials.setUsername(registrationSummary.getKeyManagerInfo().getCredentials().getUsername());
keyManagerCredentials.setPassword(registrationSummary.getKeyManagerInfo().getCredentials().getPassword());
keyManagerInfoDTO.setCredentials(keyManagerCredentials);
return keyManagerInfoDTO;
}
Aggregations