Search in sources :

Example 1 with KeyManagerListDTO

use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerListDTO 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;
}
Also used : KeyManagerConfigurationDTO(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO) KeyManagerListDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerListDTO) ArrayList(java.util.ArrayList) KeyManagerInfoDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO)

Example 2 with KeyManagerListDTO

use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerListDTO 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;
}
Also used : KeyManagerConfigurationDTO(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO) KeyManagerListDTO(org.wso2.carbon.apimgt.rest.api.store.v1.dto.KeyManagerListDTO) ArrayList(java.util.ArrayList) KeyManagerInfoDTO(org.wso2.carbon.apimgt.rest.api.store.v1.dto.KeyManagerInfoDTO)

Example 3 with KeyManagerListDTO

use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerListDTO 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;
}
Also used : KeyManagerConfigurationDTO(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO) KeyManagerListDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.KeyManagerListDTO) ArrayList(java.util.ArrayList) KeyManagerInfoDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.KeyManagerInfoDTO)

Example 4 with KeyManagerListDTO

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

the class KeyManagersApiServiceImpl method keyManagersGet.

public Response keyManagersGet(MessageContext messageContext) throws APIManagementException {
    String organization = RestApiUtil.getOrganization(messageContext);
    APIAdmin apiAdmin = new APIAdminImpl();
    List<KeyManagerConfigurationDTO> keyManagerConfigurationsByOrganization = apiAdmin.getKeyManagerConfigurationsByOrganization(organization);
    KeyManagerListDTO keyManagerListDTO = KeyManagerMappingUtil.toKeyManagerListDTO(keyManagerConfigurationsByOrganization);
    return Response.ok().entity(keyManagerListDTO).build();
}
Also used : KeyManagerConfigurationDTO(org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO) KeyManagerListDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerListDTO) APIAdmin(org.wso2.carbon.apimgt.api.APIAdmin) APIAdminImpl(org.wso2.carbon.apimgt.impl.APIAdminImpl)

Aggregations

KeyManagerConfigurationDTO (org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO)4 ArrayList (java.util.ArrayList)3 KeyManagerListDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerListDTO)2 APIAdmin (org.wso2.carbon.apimgt.api.APIAdmin)1 APIAdminImpl (org.wso2.carbon.apimgt.impl.APIAdminImpl)1 KeyManagerInfoDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.KeyManagerInfoDTO)1 KeyManagerInfoDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.KeyManagerInfoDTO)1 KeyManagerListDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.KeyManagerListDTO)1 KeyManagerInfoDTO (org.wso2.carbon.apimgt.rest.api.store.v1.dto.KeyManagerInfoDTO)1 KeyManagerListDTO (org.wso2.carbon.apimgt.rest.api.store.v1.dto.KeyManagerListDTO)1