use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationInfoDTO in project carbon-apimgt by wso2.
the class ApplicationMappingUtil method fromApplicationToInfoDTO.
/**
* Create an ApplicationInfoDTO from an Application object.
*
* @param application Application object
* @return ApplicationInfoDTO containing application information
*/
public static ApplicationInfoDTO fromApplicationToInfoDTO(Application application) {
ApplicationInfoDTO applicationInfoDTO = new ApplicationInfoDTO();
applicationInfoDTO.setApplicationId(application.getUUID());
applicationInfoDTO.setDescription(application.getDescription());
applicationInfoDTO.setName(application.getName());
applicationInfoDTO.setSubscriber(application.getSubscriber().getName());
applicationInfoDTO.setSubscriptionCount(application.getSubscriptionCount());
return applicationInfoDTO;
}
use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationInfoDTO in project carbon-apimgt by wso2.
the class GatewayUtils method generateApplicationList.
public static ApplicationListDTO generateApplicationList(List<Application> applicationList, SubscriptionDataStore subscriptionDataStore) {
ApplicationListDTO applicationListDTO = new ApplicationListDTO();
List<ApplicationInfoDTO> applicationInfoDTOList = new ArrayList<>();
for (Application application : applicationList) {
ApplicationInfoDTO applicationInfoDTO = new ApplicationInfoDTO().id(application.getId()).name(application.getName()).policy(application.getPolicy()).attributes(application.getAttributes()).subName(application.getSubName()).uuid(application.getUUID()).tokenType(application.getTokenType()).keys(convertToApplicationKeyMapping(application.getId(), subscriptionDataStore));
applicationInfoDTOList.add(applicationInfoDTO);
}
applicationListDTO.setList(applicationInfoDTOList);
applicationListDTO.setCount(applicationInfoDTOList.size());
return applicationListDTO;
}
use of org.wso2.carbon.apimgt.rest.api.store.v1.dto.ApplicationInfoDTO in project carbon-apimgt by wso2.
the class ApplicationMappingUtil method fromApplicationsToDTO.
public static ApplicationListDTO fromApplicationsToDTO(Application[] applications) {
ApplicationListDTO applicationListDTO = new ApplicationListDTO();
List<ApplicationInfoDTO> applicationInfoDTOs = applicationListDTO.getList();
if (applicationInfoDTOs == null) {
applicationInfoDTOs = new ArrayList<>();
applicationListDTO.setList(applicationInfoDTOs);
}
for (Application application : applications) {
applicationInfoDTOs.add(fromApplicationToInfoDTO(application));
}
applicationListDTO.setCount(applicationInfoDTOs.size());
return applicationListDTO;
}
Aggregations