Class DtoFactory
- java.lang.Object
-
- org.wso2.am.integration.test.impl.DtoFactory
-
public class DtoFactory extends Object
-
-
Constructor Summary
Constructors Constructor Description DtoFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AdvancedThrottlePolicyDTOcreateAdvancedThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit, List<ConditionalGroupDTO> conditionalGroups)Creates an advanced throttling policy DTO using the given parameters.static APICategoryDTOcreateApiCategoryDTO(String name, String description)Creates an api category DTO using the given parameters.static APIProductDTOcreateApiProductDTO(String provider, String name, String context, List<ProductAPIDTO> apis, List<String> polices)static ApplicationThrottlePolicyDTOcreateApplicationThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit)Creates an application throttling policy DTO using the given parameters.static BandwidthLimitDTOcreateBandwidthLimitDTO(String timeUnit, Integer unitTime, Long dataAmount, String dataUnit)Creates a bandwidth limit DTO using the given parameters.static ConditionalGroupDTOcreateConditionalGroupDTO(String description, List<ThrottleConditionDTO> conditions, ThrottleLimitDTO limit)Creates a conditional group DTO using the given parameters.static CustomRuleDTOcreateCustomThrottlePolicyDTO(String policyName, String description, boolean isDeployed, String siddhiQuery, String keyTemplate)Creates a custom throttling policy DTO using the given parameters.static EnvironmentDTOcreateEnvironmentDTO(String name, String displayName, String description, String provider, boolean isReadOnly, List<VHostDTO> vhosts)Creates an Environment DTO using the given parametersstatic EventCountLimitDTOcreateEventCountLimitDTO(String timeUnit, Integer unitTime, Long eventCount)Creates a event count limit DTO using the given parameters.static ThrottleLimitDTOcreateEventCountThrottleLimitDTO(EventCountLimitDTO eventCountLimitDTO)Creates a throttle limit DTO using the given event count limit DTO.static ExportThrottlePolicyDTOcreateExportThrottlePolicyDTO(String type, String subtype, String version, Object data)Creates Exported ThrottlingPolicyDTO using the given datastatic HeaderConditionDTOcreateHeaderConditionDTO(String headerName, String headerValue)Creates a header condition DTO using the given parameters.static IPConditionDTOcreateIPConditionDTO(IPConditionDTO.IpConditionTypeEnum ipConditionType, String specificIP, String startingIP, String endingIP)Creates a IP condition DTO using the given parameters.static JWTClaimsConditionDTOcreateJWTClaimsConditionDTO(String claimUrl, String attribute)Creates a JWT claims condition DTO using the given parameters.static KeyManagerCertificatesDTOcreateKeyManagerCertificatesDTO(KeyManagerCertificatesDTO.TypeEnum type, String value)Creates an key manager certificate DTO using the given parameters.static KeyManagerDTOcreateKeyManagerDTO(String name, String description, String type, String displayName, String introspectionEndpoint, String issuer, String clientRegistrationEndpoint, String tokenEndpoint, String revokeEndpoint, String userInfoEndpoint, String authorizeEndpoint, String scopeManagementEndpoint, String consumerKeyClaim, String scopesClaim, List<String> availableGrantTypes, Object additionalProperties, KeyManagerCertificatesDTO certificates)Creates an key manager DTO using the given parameters.static KeyManagerDTOcreateKeyManagerDTO(String name, String description, String type, String displayName, String issuer, String consumerKeyClaim, String scopesClaim, List<String> availableGrantTypes, KeyManagerCertificatesDTO certificates)Creates an key manager DTO using the given parameters.static LabelDTOcreateLabelDTO(String name, String description, List<String> accessUrls)Creates a label DTO using the given parameters.static QueryParameterConditionDTOcreateQueryParameterConditionDTO(String parameterName, String parameterValue)Creates a query parameter condition DTO using the given parameters.static RequestCountLimitDTOcreateRequestCountLimitDTO(String timeUnit, Integer unitTime, Long requestCount)Creates a request count limit DTO using the given parameters.static SubscriptionThrottlePolicyDTOcreateSubscriptionThrottlePolicyDTO(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, SubscriptionThrottlePolicyPermissionDTO permissions)Creates a subscription throttling policy DTO using the given parameters.static SubscriptionThrottlePolicyDTOcreateSubscriptionThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit, int rateLimitCount, String rateLimitTimeUnit, boolean stopQuotaOnReach, SubscriptionThrottlePolicyPermissionDTO permissions)Creates a subscription throttling policy DTO using the given parameters.static SubscriptionThrottlePolicyPermissionDTOcreateSubscriptionThrottlePolicyPermissionDTO(SubscriptionThrottlePolicyPermissionDTO.PermissionTypeEnum permissionType, List<String> roles)Creates a subscription throttling permission DTO using the given parameters.static ThrottleConditionDTOcreateThrottleConditionDTO(ThrottleConditionDTO.TypeEnum type, boolean invertCondition, HeaderConditionDTO headerCondition, IPConditionDTO ipCondition, JWTClaimsConditionDTO jwtClaimsCondition, QueryParameterConditionDTO queryParameterCondition)Creates a throttle condition DTO using the given parameters.static ThrottleLimitDTOcreateThrottleLimitDTO(ThrottleLimitDTO.TypeEnum type, RequestCountLimitDTO requestCountLimitDTO, BandwidthLimitDTO bandwidthLimitDTO)Creates a throttle limit DTO using the given parameters.static VHostDTOcreateVhostDTO(String host, String httpContext, Integer httpPort, Integer httpsPort, Integer wsPort, Integer wssPort)Creates a Vhost DTO using the given parameters
-
-
-
Method Detail
-
createExportThrottlePolicyDTO
public static ExportThrottlePolicyDTO createExportThrottlePolicyDTO(String type, String subtype, String version, Object data)
Creates Exported ThrottlingPolicyDTO using the given data- Parameters:
type- Policy Typesubtype- Throttling Policy Typeversion- APIM versiondata- Throttling Policy data- Returns:
-
createApiProductDTO
public static APIProductDTO createApiProductDTO(String provider, String name, String context, List<ProductAPIDTO> apis, List<String> polices)
-
createApplicationThrottlePolicyDTO
public static ApplicationThrottlePolicyDTO createApplicationThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit)
Creates an application throttling policy DTO using the given parameters.- Parameters:
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.- Returns:
- Created application throttling policy DTO.
-
createThrottleLimitDTO
public static ThrottleLimitDTO createThrottleLimitDTO(ThrottleLimitDTO.TypeEnum type, RequestCountLimitDTO requestCountLimitDTO, BandwidthLimitDTO bandwidthLimitDTO)
Creates a throttle limit DTO using the given parameters.- Parameters:
type- Type of the throttle limit. (Eg:- Request Count Limit, Bandwidth Limit)requestCountLimitDTO- Request count limit DTO object.bandwidthLimitDTO- Bandwidth limit DTO object.- Returns:
- Created throttle limit DTO.
-
createEventCountThrottleLimitDTO
public static ThrottleLimitDTO createEventCountThrottleLimitDTO(EventCountLimitDTO eventCountLimitDTO)
Creates a throttle limit DTO using the given event count limit DTO.- Parameters:
eventCountLimitDTO- Event count limit DTO object.- Returns:
- Created throttle limit DTO.
-
createRequestCountLimitDTO
public static RequestCountLimitDTO createRequestCountLimitDTO(String timeUnit, Integer unitTime, Long requestCount)
Creates a request count limit DTO using the given parameters.- Parameters:
timeUnit- Time limit.unitTime- Unit of time.requestCount- Request count limit.- Returns:
- Created request count limit DTO.
-
createBandwidthLimitDTO
public static BandwidthLimitDTO createBandwidthLimitDTO(String timeUnit, Integer unitTime, Long dataAmount, String dataUnit)
Creates a bandwidth limit DTO using the given parameters.- Parameters:
timeUnit- Time limit.unitTime- Unit of time.dataAmount- Data amount limit.dataUnit- Unit of data.- Returns:
- Created bandwidth limit DTO.
-
createSubscriptionThrottlePolicyPermissionDTO
public static SubscriptionThrottlePolicyPermissionDTO createSubscriptionThrottlePolicyPermissionDTO(SubscriptionThrottlePolicyPermissionDTO.PermissionTypeEnum permissionType, List<String> roles)
Creates a subscription throttling permission DTO using the given parameters.- Parameters:
permissionType- Permission type.roles- Roles.- Returns:
- Created subscription throttle policy DTO.
-
createEventCountLimitDTO
public static EventCountLimitDTO createEventCountLimitDTO(String timeUnit, Integer unitTime, Long eventCount)
Creates a event count limit DTO using the given parameters.- Parameters:
timeUnit- Time limit.unitTime- Unit of time.eventCount- Event count limit.- Returns:
- Created event count limit DTO.
-
createSubscriptionThrottlePolicyDTO
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, SubscriptionThrottlePolicyPermissionDTO permissions)
Creates a subscription throttling policy DTO using the given parameters.- Parameters:
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.- Returns:
- Created subscription throttling policy DTO.
-
createSubscriptionThrottlePolicyDTO
public static SubscriptionThrottlePolicyDTO createSubscriptionThrottlePolicyDTO(String policyName, String displayName, String description, boolean isDeployed, ThrottleLimitDTO defaultLimit, int rateLimitCount, String rateLimitTimeUnit, boolean stopQuotaOnReach, SubscriptionThrottlePolicyPermissionDTO permissions)
Creates a subscription throttling policy DTO using the given parameters.- Parameters:
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.rateLimitCount- Burst control request count.rateLimitTimeUnit- Burst control time unit.stopQuotaOnReach- Action to be taken when a user goes beyond the allocated quota.- Returns:
- Created subscription throttling policy DTO.
-
createCustomThrottlePolicyDTO
public static CustomRuleDTO createCustomThrottlePolicyDTO(String policyName, String description, boolean isDeployed, String siddhiQuery, String keyTemplate)
Creates a custom throttling policy DTO using the given parameters.- Parameters:
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.- Returns:
- Created custom throttling policy DTO.
-
createHeaderConditionDTO
public static HeaderConditionDTO createHeaderConditionDTO(String headerName, String headerValue)
Creates a header condition DTO using the given parameters.- Parameters:
headerName- Name of the header.headerValue- Value of the header.- Returns:
- Created header condition DTO.
-
createIPConditionDTO
public static IPConditionDTO createIPConditionDTO(IPConditionDTO.IpConditionTypeEnum ipConditionType, String specificIP, String startingIP, String endingIP)
Creates a IP condition DTO using the given parameters.- Parameters:
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.- Returns:
- Created IP condition DTO.
-
createJWTClaimsConditionDTO
public static JWTClaimsConditionDTO createJWTClaimsConditionDTO(String claimUrl, String attribute)
Creates a JWT claims condition DTO using the given parameters.- Parameters:
claimUrl- JWT claim URL.attribute- Attribute to be matched.- Returns:
- Created JWT claims condition DTO.
-
createQueryParameterConditionDTO
public static QueryParameterConditionDTO createQueryParameterConditionDTO(String parameterName, String parameterValue)
Creates a query parameter condition DTO using the given parameters.- Parameters:
parameterName- Name of the query parameter.parameterValue- Value of the query parameter to be matched.- Returns:
- Created query parameter condition DTO.
-
createThrottleConditionDTO
public 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.- Parameters:
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.- Returns:
- Created throttle condition DTO.
-
createConditionalGroupDTO
public static ConditionalGroupDTO createConditionalGroupDTO(String description, List<ThrottleConditionDTO> conditions, ThrottleLimitDTO limit)
Creates a conditional group DTO using the given parameters.- Parameters:
description- Description of the conditional group.conditions- Individual throttling conditions.limit- Throttle limit of the conditional group.- Returns:
- Created conditional group DTO.
-
createAdvancedThrottlePolicyDTO
public 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.- Parameters:
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.- Returns:
- Created advanced throttling policy DTO.
-
createLabelDTO
public static LabelDTO createLabelDTO(String name, String description, List<String> accessUrls)
Creates a label DTO using the given parameters.- Parameters:
name- Name of the label.description- Description of the label.accessUrls- Access URLs.- Returns:
- Created label DTO.
-
createEnvironmentDTO
public static EnvironmentDTO createEnvironmentDTO(String name, String displayName, String description, String provider, boolean isReadOnly, List<VHostDTO> vhosts)
Creates an Environment DTO using the given parameters- Parameters:
name- Name of the environmentdisplayName- Display name of the environmentdescription- Description of the environmentprovider- Vendor provider of the environmentvhosts- Vhosts available in the environment- Returns:
- Environment DTO object
-
createVhostDTO
public static VHostDTO createVhostDTO(String host, String httpContext, Integer httpPort, Integer httpsPort, Integer wsPort, Integer wssPort)
Creates a Vhost DTO using the given parameters- Parameters:
host- Host namehttpContext- HTTP context of access URLhttpPort- HTTP porthttpsPort- HTTPS portwsPort- WS portwssPort- WSS port- Returns:
- VHost DTO object
-
createApiCategoryDTO
public static APICategoryDTO createApiCategoryDTO(String name, String description)
Creates an api category DTO using the given parameters.- Parameters:
name- Name of the label.description- Description of the label.- Returns:
- Created api category DTO.
-
createKeyManagerDTO
public static KeyManagerDTO createKeyManagerDTO(String name, String description, String type, String displayName, String issuer, String consumerKeyClaim, String scopesClaim, List<String> availableGrantTypes, KeyManagerCertificatesDTO certificates)
Creates an key manager DTO using the given parameters.- Parameters:
name- Name of key manager.displayName- Display name of the key manager.description- Description of the key manager.type- Type of the key manager.issuer- Issuer of the key manager.consumerKeyClaim- Consumer key claim URI of the key manager.scopesClaim- Scopes claim URI of the key manager.availableGrantTypes- Available grant types of the key manager.certificates- Certificates of the key manager.- Returns:
- Created key manager DTO.
-
createKeyManagerDTO
public static KeyManagerDTO createKeyManagerDTO(String name, String description, String type, String displayName, String introspectionEndpoint, String issuer, String clientRegistrationEndpoint, String tokenEndpoint, String revokeEndpoint, String userInfoEndpoint, String authorizeEndpoint, String scopeManagementEndpoint, String consumerKeyClaim, String scopesClaim, List<String> availableGrantTypes, Object additionalProperties, KeyManagerCertificatesDTO certificates)
Creates an key manager DTO using the given parameters.- Parameters:
name- Name of key manager.displayName- Display name of the key manager.description- Description of the key manager.type- Type of the key manager.issuer- Issuer of the key manager.clientRegistrationEndpoint- Client registration endpoint of the key manager.introspectionEndpoint- Introspection endpoint of the key manager.tokenEndpoint- Token endpoint of the key manager.revokeEndpoint- Revoke endpoint of the key manager.userInfoEndpoint- User info endpoint of the key manager.authorizeEndpoint- Authorize endpoint of the key manager.scopeManagementEndpoint- Scope management endpoint of the key manager.consumerKeyClaim- Consumer key claim URI of the key manager.scopesClaim- Scopes claim URI of the key manager.availableGrantTypes- Available grant types of the key manager.additionalProperties- Additional properties of the key manager.certificates- Certificates of the key manager.- Returns:
- Created key manager DTO.
-
createKeyManagerCertificatesDTO
public static KeyManagerCertificatesDTO createKeyManagerCertificatesDTO(KeyManagerCertificatesDTO.TypeEnum type, String value)
Creates an key manager certificate DTO using the given parameters.- Parameters:
type- Type of the key manager certificate.value- Value of the key manager certificate.- Returns:
- Created key manager certificate DTO.
-
-