use of org.wso2.carbon.apimgt.rest.api.gateway.dto.SubscriptionInfoDTO in project carbon-apimgt by wso2.
the class AnalyticsMappingUtil method fromSubscriptionInfoListToDTO.
public static SubscriptionInfoListDTO fromSubscriptionInfoListToDTO(List<SubscriptionInfo> subscriptionInfoList, ZoneId zoneId) {
SubscriptionInfoListDTO subscriptionCountListDTO = new SubscriptionInfoListDTO();
List<SubscriptionInfoDTO> subscriptionInfoDTOList = new ArrayList<>();
subscriptionCountListDTO.setCount(subscriptionInfoList.size());
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) {
SubscriptionInfoDTO subscriptionInfoDTO = new SubscriptionInfoDTO();
subscriptionInfoDTO.setId(subscriptionInfo.getId());
subscriptionInfoDTO.setName(subscriptionInfo.getName());
subscriptionInfoDTO.setVersion(subscriptionInfo.getVersion());
subscriptionInfoDTO.setAppName(subscriptionInfo.getAppName());
subscriptionInfoDTO.setDescription(subscriptionInfo.getDescription());
subscriptionInfoDTO.setCreatedTime(epochToISO8601DateTime(subscriptionInfo.getCreatedTime(), zoneId));
subscriptionInfoDTO.setSubscriptionStatus(subscriptionInfo.getSubscriptionStatus());
subscriptionInfoDTO.setSubscriptionTier(subscriptionInfo.getSubscriptionTier());
subscriptionInfoDTOList.add(subscriptionInfoDTO);
}
subscriptionCountListDTO.setList(subscriptionInfoDTOList);
return subscriptionCountListDTO;
}
use of org.wso2.carbon.apimgt.rest.api.gateway.dto.SubscriptionInfoDTO in project carbon-apimgt by wso2.
the class GatewayUtils method convertSubscriptionsToSubscriptionInfo.
private static List<SubscriptionInfoDTO> convertSubscriptionsToSubscriptionInfo(List<Subscription> subscriptions, SubscriptionDataStore subscriptionDataStore) {
List<SubscriptionInfoDTO> subscriptionInfoDTOList = new ArrayList<>();
for (Subscription subscription : subscriptions) {
SubscriptionInfoDTO subscriptionInfoDTO = new SubscriptionInfoDTO();
subscriptionInfoDTO.setStatus(subscription.getSubscriptionState());
subscriptionInfoDTO.setSubscriptionUUID(subscription.getSubscriptionUUId());
subscriptionInfoDTO.setSubscriptionPolicy(subscription.getPolicyId());
subscriptionInfoDTO.setApplication(convertToApplicationDto(subscription.getAppId(), subscriptionDataStore));
subscriptionInfoDTOList.add(subscriptionInfoDTO);
}
return subscriptionInfoDTOList;
}
Aggregations