use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.EventCountLimitDTO in project carbon-apimgt by wso2.
the class CommonThrottleMappingUtil method fromDTOToEventCountLimit.
private static EventCountLimit fromDTOToEventCountLimit(EventCountLimitDTO dto) {
EventCountLimit eventCountLimit = new EventCountLimit();
eventCountLimit.setTimeUnit(dto.getTimeUnit());
eventCountLimit.setUnitTime(dto.getUnitTime());
eventCountLimit.setEventCount(dto.getEventCount());
return eventCountLimit;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.EventCountLimitDTO in project carbon-apimgt by wso2.
the class ThrottlingPolicyMappingUtil method fromSubscriptionToDTO.
public static SubscriptionPolicyDTO fromSubscriptionToDTO(SubscriptionPolicy subscriptionPolicy, int position) {
SubscriptionPolicyDTO dto = new SubscriptionPolicyDTO();
dto.setRateLimitCount(subscriptionPolicy.getRateLimitCount());
dto.setRateLimitTimeUnit(subscriptionPolicy.getRateLimitTimeUnit());
dto.setStopOnQuotaReach(subscriptionPolicy.isStopOnQuotaReach());
ThrottleLimitDTO limitDTO = new ThrottleLimitDTO();
limitDTO.setType(ThrottleLimitDTO.TypeEnum.EVENTCOUNTLIMIT);
EventCountLimit eventCountLimit = (EventCountLimit) subscriptionPolicy.getDefaultQuotaPolicy().getLimit();
EventCountLimitDTO eventCountLimitDTO = new EventCountLimitDTO();
eventCountLimitDTO.setEventCount(eventCountLimit.getEventCount());
eventCountLimitDTO.setTimeUnit(eventCountLimit.getTimeUnit());
eventCountLimitDTO.setUnitTime(eventCountLimit.getUnitTime());
limitDTO.setEventCount(eventCountLimitDTO);
dto.setDefaultLimit(limitDTO);
dto.setSubscriberCount(subscriptionPolicy.getSubscriberCount());
dto.setDisplayName(subscriptionPolicy.getDisplayName());
dto.setDescription(subscriptionPolicy.getDescription());
dto.setIsDeployed(subscriptionPolicy.isDeployed());
dto.setPolicyName(subscriptionPolicy.getPolicyName());
dto.setBillingPlan(subscriptionPolicy.getBillingPlan());
dto.setPolicyId(position);
dto.setUuid(subscriptionPolicy.getUUID());
dto.setIsDeployed(subscriptionPolicy.isDeployed());
dto.setTenantDomain(subscriptionPolicy.getTenantDomain());
dto.setTenantId(subscriptionPolicy.getTenantId());
return dto;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.EventCountLimitDTO in project carbon-apimgt by wso2.
the class SubscriptionValidationDataUtil method fromEventCountLimitToDTO.
/**
* Converts a Event Count Limit model object into a Event Count Limit DTO object.
*
* @param eventCountLimit Event Count Limit model object
* @return Event Count Limit DTO object derived from model
*/
private static EventCountLimitDTO fromEventCountLimitToDTO(EventCountLimit eventCountLimit) {
EventCountLimitDTO dto = new EventCountLimitDTO();
dto.setTimeUnit(eventCountLimit.getTimeUnit());
dto.setUnitTime(eventCountLimit.getUnitTime());
dto.setEventCount(eventCountLimit.getEventCount());
return dto;
}
use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.EventCountLimitDTO in project carbon-apimgt by wso2.
the class CommonThrottleMappingUtil method fromEventCountLimitToDTO.
public static EventCountLimitDTO fromEventCountLimitToDTO(EventCountLimit eventCountLimit) {
EventCountLimitDTO dto = new EventCountLimitDTO();
dto.setTimeUnit(eventCountLimit.getTimeUnit());
dto.setUnitTime(eventCountLimit.getUnitTime());
dto.setEventCount(eventCountLimit.getEventCount());
return dto;
}
Aggregations