Search in sources :

Example 6 with ConditionalGroupDTO

use of org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ConditionalGroupDTO in project carbon-apimgt by wso2.

the class CommonThrottleMappingUtil method fromPipelineToConditionalGroupDTO.

/**
 * Converts a single Pipeline object into a Conditional Group DTO object
 *
 * @param pipeline Pipeline object
 * @return Derived DTO object from Pipeline object
 * @throws UnsupportedThrottleLimitTypeException
 * @throws UnsupportedThrottleConditionTypeException
 */
public static ConditionalGroupDTO fromPipelineToConditionalGroupDTO(Pipeline pipeline) throws UnsupportedThrottleLimitTypeException, UnsupportedThrottleConditionTypeException {
    ConditionalGroupDTO groupDTO = new ConditionalGroupDTO();
    groupDTO.setDescription(pipeline.getDescription());
    groupDTO.setLimit(fromQuotaPolicyToDTO(pipeline.getQuotaPolicy()));
    List<ThrottleConditionDTO> conditionDTOList = fromConditionListToDTOList(pipeline.getConditions());
    groupDTO.setConditions(conditionDTOList);
    return groupDTO;
}
Also used : ConditionalGroupDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ConditionalGroupDTO) ThrottleConditionDTO(org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ThrottleConditionDTO)

Aggregations

ConditionalGroupDTO (org.wso2.carbon.apimgt.rest.api.admin.dto.ConditionalGroupDTO)2 ConditionalGroupDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ConditionalGroupDTO)2 Condition (org.wso2.carbon.apimgt.api.model.policy.Condition)1 HeaderCondition (org.wso2.carbon.apimgt.api.model.policy.HeaderCondition)1 IPCondition (org.wso2.carbon.apimgt.api.model.policy.IPCondition)1 JWTClaimsCondition (org.wso2.carbon.apimgt.api.model.policy.JWTClaimsCondition)1 Pipeline (org.wso2.carbon.apimgt.api.model.policy.Pipeline)1 QueryParameterCondition (org.wso2.carbon.apimgt.api.model.policy.QueryParameterCondition)1 Condition (org.wso2.carbon.apimgt.core.models.policy.Condition)1 HeaderCondition (org.wso2.carbon.apimgt.core.models.policy.HeaderCondition)1 IPCondition (org.wso2.carbon.apimgt.core.models.policy.IPCondition)1 JWTClaimsCondition (org.wso2.carbon.apimgt.core.models.policy.JWTClaimsCondition)1 Pipeline (org.wso2.carbon.apimgt.core.models.policy.Pipeline)1 QueryParameterCondition (org.wso2.carbon.apimgt.core.models.policy.QueryParameterCondition)1 AdvancedThrottlePolicyDTO (org.wso2.carbon.apimgt.rest.api.admin.dto.AdvancedThrottlePolicyDTO)1 ThrottleConditionDTO (org.wso2.carbon.apimgt.rest.api.admin.dto.ThrottleConditionDTO)1 AdvancedThrottlePolicyDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.AdvancedThrottlePolicyDTO)1 ThrottleConditionDTO (org.wso2.carbon.apimgt.rest.api.admin.v1.dto.ThrottleConditionDTO)1