public class DtoFactory extends Object
| Constructor and Description |
|---|
DtoFactory() |
| Modifier and Type | Method and Description |
|---|---|
static AdvancedThrottlePolicyDTO |
createAdvancedThrottlePolicyDTO(String policyName,
String displayName,
String description,
boolean isDeployed,
ThrottleLimitDTO defaultLimit,
List<ConditionalGroupDTO> conditionalGroups)
Creates an advanced throttling policy DTO using the given parameters.
|
static APICategoryDTO |
createApiCategoryDTO(String name,
String description)
Creates an api category DTO using the given parameters.
|
static APIProductDTO |
createApiProductDTO(String provider,
String name,
String context,
List<ProductAPIDTO> apis,
List<String> polices) |
static ApplicationThrottlePolicyDTO |
createApplicationThrottlePolicyDTO(String policyName,
String displayName,
String description,
boolean isDeployed,
ThrottleLimitDTO defaultLimit)
Creates an application throttling policy DTO using the given parameters.
|
static BandwidthLimitDTO |
createBandwidthLimitDTO(String timeUnit,
Integer unitTime,
Long dataAmount,
String dataUnit)
Creates a bandwidth limit DTO using the given parameters.
|
static ConditionalGroupDTO |
createConditionalGroupDTO(String description,
List<ThrottleConditionDTO> conditions,
ThrottleLimitDTO limit)
Creates a conditional group DTO using the given parameters.
|
static CustomRuleDTO |
createCustomThrottlePolicyDTO(String policyName,
String description,
boolean isDeployed,
String siddhiQuery,
String keyTemplate)
Creates a custom throttling policy DTO using the given parameters.
|
static EnvironmentDTO |
createEnvironmentDTO(String name,
String displayName,
String description,
boolean isReadOnly,
List<VHostDTO> vhosts)
Creates an Environment DTO using the given parameters
|
static EventCountLimitDTO |
createEventCountLimitDTO(String timeUnit,
Integer unitTime,
Long eventCount)
Creates a event count limit DTO using the given parameters.
|
static ThrottleLimitDTO |
createEventCountThrottleLimitDTO(EventCountLimitDTO eventCountLimitDTO)
Creates a throttle limit DTO using the given event count limit DTO.
|
static HeaderConditionDTO |
createHeaderConditionDTO(String headerName,
String headerValue)
Creates a header condition DTO using the given parameters.
|
static IPConditionDTO |
createIPConditionDTO(IPConditionDTO.IpConditionTypeEnum ipConditionType,
String specificIP,
String startingIP,
String endingIP)
Creates a IP condition DTO using the given parameters.
|
static JWTClaimsConditionDTO |
createJWTClaimsConditionDTO(String claimUrl,
String attribute)
Creates a JWT claims condition DTO using the given parameters.
|
static LabelDTO |
createLabelDTO(String name,
String description,
List<String> accessUrls)
Creates a label DTO using the given parameters.
|
static QueryParameterConditionDTO |
createQueryParameterConditionDTO(String parameterName,
String parameterValue)
Creates a query parameter condition DTO using the given parameters.
|
static RequestCountLimitDTO |
createRequestCountLimitDTO(String timeUnit,
Integer unitTime,
Long requestCount)
Creates a request count limit DTO using the given parameters.
|
static SubscriptionThrottlePolicyDTO |
createSubscriptionThrottlePolicyDTO(String policyName,
String displayName,
String description,
boolean isDeployed,
ThrottleLimitDTO defaultLimit,
int graphQLMaxComplexity,
int graphQLMaxDepth,
int rateLimitCount,
String rateLimitTimeUnit,
List<CustomAttributeDTO> customAttributes,
boolean stopQuotaOnReach,
String billingPlan,
int subscriberCount)
Creates a subscription throttling policy DTO using the given parameters.
|
static ThrottleConditionDTO |
createThrottleConditionDTO(ThrottleConditionDTO.TypeEnum type,
boolean invertCondition,
HeaderConditionDTO headerCondition,
IPConditionDTO ipCondition,
JWTClaimsConditionDTO jwtClaimsCondition,
QueryParameterConditionDTO queryParameterCondition)
Creates a throttle condition DTO using the given parameters.
|
static ThrottleLimitDTO |
createThrottleLimitDTO(ThrottleLimitDTO.TypeEnum type,
RequestCountLimitDTO requestCountLimitDTO,
BandwidthLimitDTO bandwidthLimitDTO)
Creates a throttle limit DTO using the given parameters.
|
static VHostDTO |
createVhostDTO(String host,
String httpContext,
Integer httpPort,
Integer httpsPort,
Integer wsPort,
Integer wssPort)
Creates a Vhost DTO using the given parameters
|
public static APIProductDTO createApiProductDTO(String provider, String name, String context, List<ProductAPIDTO> apis, List<String> polices)
public static ApplicationThrottlePolicyDTO createApplicationThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit)
policyName - Name of the policy.displayName - Display name of the policy.description - Description of the policy.isDeployed - Deployed status of the policy.defaultLimit - Default Limit of the policy.public static ThrottleLimitDTO createThrottleLimitDTO(ThrottleLimitDTO.TypeEnum type, RequestCountLimitDTO requestCountLimitDTO, BandwidthLimitDTO bandwidthLimitDTO)
type - Type of the throttle limit. (Eg:- Request Count Limit, Bandwidth Limit)requestCountLimitDTO - Request count limit DTO object.bandwidthLimitDTO - Bandwidth limit DTO object.public static ThrottleLimitDTO createEventCountThrottleLimitDTO(EventCountLimitDTO eventCountLimitDTO)
eventCountLimitDTO - Event count limit DTO object.public static RequestCountLimitDTO createRequestCountLimitDTO(String timeUnit, Integer unitTime, Long requestCount)
timeUnit - Time limit.unitTime - Unit of time.requestCount - Request count limit.public static BandwidthLimitDTO createBandwidthLimitDTO(String timeUnit, Integer unitTime, Long dataAmount, String dataUnit)
timeUnit - Time limit.unitTime - Unit of time.dataAmount - Data amount limit.dataUnit - Unit of data.public static EventCountLimitDTO createEventCountLimitDTO(String timeUnit, Integer unitTime, Long eventCount)
timeUnit - Time limit.unitTime - Unit of time.eventCount - Event count limit.public static SubscriptionThrottlePolicyDTO createSubscriptionThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit, int graphQLMaxComplexity, int graphQLMaxDepth, int rateLimitCount, String rateLimitTimeUnit, List<CustomAttributeDTO> customAttributes, boolean stopQuotaOnReach, String billingPlan, int subscriberCount)
policyName - Name of the policy.displayName - Display name of the policy.description - Description of the policy.isDeployed - Deployed status of the policy.defaultLimit - Default Limit of the policy.graphQLMaxComplexity - Maximum Complexity of the GraphQL query.graphQLMaxDepth - Maximum Depth of the GraphQL query.rateLimitCount - Burst control request count.rateLimitTimeUnit - Burst control time unit.customAttributes - Custom attributes added to the Subscription Throttling Policy.stopQuotaOnReach - Action to be taken when a user goes beyond the allocated quota.billingPlan - Defines whether this is a Paid or a Free plan.public static CustomRuleDTO createCustomThrottlePolicyDTO(String policyName, String description, boolean isDeployed, String siddhiQuery, String keyTemplate)
policyName - Name of the policy.description - Description of the policy.isDeployed - Deployed status of the policy.siddhiQuery - Siddhi query which represents the custom throttling policy.keyTemplate - The specific combination of attributes that are checked in the policy.public static HeaderConditionDTO createHeaderConditionDTO(String headerName, String headerValue)
headerName - Name of the header.headerValue - Value of the header.public static IPConditionDTO createIPConditionDTO(IPConditionDTO.IpConditionTypeEnum ipConditionType, String specificIP, String startingIP, String endingIP)
ipConditionType - Type of the IP condition.specificIP - Specific IP when "IPSPECIFIC" is used as the ipConditionType.startingIP - Staring IP when "IPRANGE" is used as the ipConditionTypeendingIP - Ending IP when "IPRANGE" is used as the ipConditionType.public static JWTClaimsConditionDTO createJWTClaimsConditionDTO(String claimUrl, String attribute)
claimUrl - JWT claim URL.attribute - Attribute to be matched.public static QueryParameterConditionDTO createQueryParameterConditionDTO(String parameterName, String parameterValue)
parameterName - Name of the query parameter.parameterValue - Value of the query parameter to be matched.public static ThrottleConditionDTO createThrottleConditionDTO(ThrottleConditionDTO.TypeEnum type, boolean invertCondition, HeaderConditionDTO headerCondition, IPConditionDTO ipCondition, JWTClaimsConditionDTO jwtClaimsCondition, QueryParameterConditionDTO queryParameterCondition)
type - Type of the throttling condition.invertCondition - Specifies whether inversion of the condition to be matched against the request.headerCondition - HTTP Header based throttling condition.ipCondition - IP based throttling condition.jwtClaimsCondition - JWT claim attribute based throttling condition.queryParameterCondition - Query parameter based throttling condition.public static ConditionalGroupDTO createConditionalGroupDTO(String description, List<ThrottleConditionDTO> conditions, ThrottleLimitDTO limit)
description - Description of the conditional group.conditions - Individual throttling conditions.limit - Throttle limit of the conditional group.public static AdvancedThrottlePolicyDTO createAdvancedThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit, List<ConditionalGroupDTO> conditionalGroups)
policyName - Name of the policy.displayName - Display name of the policy.description - Description of the policy.isDeployed - Deployed status of the policy.defaultLimit - Default Limit of the policy.conditionalGroups - List of conditional groups attached to the policy.public static LabelDTO createLabelDTO(String name, String description, List<String> accessUrls)
name - Name of the label.description - Description of the label.accessUrls - Access URLs.public static EnvironmentDTO createEnvironmentDTO(String name, String displayName, String description, boolean isReadOnly, List<VHostDTO> vhosts)
name - Name of the environmentdisplayName - Display name of the environmentdescription - Description of the environmentvhosts - Vhosts available in the environmentpublic static VHostDTO createVhostDTO(String host, String httpContext, Integer httpPort, Integer httpsPort, Integer wsPort, Integer wssPort)
host - Host namehttpContext - HTTP context of access URLhttpPort - HTTP porthttpsPort - HTTPS portwsPort - WS portwssPort - WSS portpublic static APICategoryDTO createApiCategoryDTO(String name, String description)
name - Name of the label.description - Description of the label.Copyright © 2021 WSO2 Inc. All rights reserved.