Search in sources :

Example 1 with AnalyticsInfoDTO

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

the class MappingUtil method toAnalyticsDTO.

/**
 * Converts RegistrationSummary analytics information into AnalyticsInfoDTO
 *
 * @param registrationSummary the registration summary required by gateway
 * @return AnalyticsInfoDTO
 */
private static AnalyticsInfoDTO toAnalyticsDTO(RegistrationSummary registrationSummary) {
    AnalyticsInfoDTO analyticsInfoDTO = new AnalyticsInfoDTO();
    analyticsInfoDTO.serverURL(registrationSummary.getAnalyticsInfo().getDasServerURL());
    analyticsInfoDTO.setEnabled(registrationSummary.getAnalyticsInfo().isEnabled());
    CredentialsDTO analyticsServerCredentials = new CredentialsDTO();
    analyticsServerCredentials.setUsername(registrationSummary.getAnalyticsInfo().getDasServerCredentials().getUsername());
    analyticsServerCredentials.setPassword(registrationSummary.getAnalyticsInfo().getDasServerCredentials().getPassword());
    analyticsInfoDTO.setCredentials(analyticsServerCredentials);
    return analyticsInfoDTO;
}
Also used : CredentialsDTO(org.wso2.carbon.apimgt.rest.api.core.dto.CredentialsDTO) AnalyticsInfoDTO(org.wso2.carbon.apimgt.rest.api.core.dto.AnalyticsInfoDTO)

Aggregations

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