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