Search in sources :

Example 1 with ThrottlingInfoDTO

use of org.wso2.carbon.apimgt.rest.api.core.dto.ThrottlingInfoDTO in project carbon-apimgt by wso2.

the class MappingUtil method toThrottlingInfoDTO.

/**
 * Converts RegistrationSummary Throttling information into ThrottlingInfoDTO
 *
 * @param registrationSummary the registration summary required by gateway
 * @return ThrottlingInfoDTO
 */
private static ThrottlingInfoDTO toThrottlingInfoDTO(RegistrationSummary registrationSummary) {
    ThrottlingInfoDTO throttlingInfoDTO = new ThrottlingInfoDTO();
    throttlingInfoDTO.serverURL(registrationSummary.getThrottlingInfo().getDataPublisher().getReceiverURL());
    CredentialsDTO throttlingServerCredentials = new CredentialsDTO();
    throttlingServerCredentials.setUsername(registrationSummary.getThrottlingInfo().getDataPublisher().getCredentials().getUsername());
    throttlingServerCredentials.setPassword(registrationSummary.getThrottlingInfo().getDataPublisher().getCredentials().getPassword());
    throttlingInfoDTO.setCredentials(throttlingServerCredentials);
    return throttlingInfoDTO;
}
Also used : CredentialsDTO(org.wso2.carbon.apimgt.rest.api.core.dto.CredentialsDTO) ThrottlingInfoDTO(org.wso2.carbon.apimgt.rest.api.core.dto.ThrottlingInfoDTO)

Aggregations

CredentialsDTO (org.wso2.carbon.apimgt.rest.api.core.dto.CredentialsDTO)1 ThrottlingInfoDTO (org.wso2.carbon.apimgt.rest.api.core.dto.ThrottlingInfoDTO)1