@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class RateBasedRule extends Object implements Serializable, Cloneable, StructuredPojo
This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.
For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.
 A RateBasedRule is identical to a regular Rule, with one addition: a RateBasedRule
 counts the number of requests that arrive from a specified IP address every five minutes. For example, based on
 recent requests that you've seen from an attacker, you might create a RateBasedRule that includes the
 following conditions:
 
The requests come from 192.0.2.44.
 They contain the value BadBot in the User-Agent header.
 
In the rule, you also define the rate limit as 1,000.
Requests that meet both of these conditions and exceed 1,000 requests every five minutes trigger the rule's action (block or count), which is defined in the web ACL.
| Constructor and Description | 
|---|
| RateBasedRule() | 
| Modifier and Type | Method and Description | 
|---|---|
| RateBasedRule | clone() | 
| boolean | equals(Object obj) | 
| List<Predicate> | getMatchPredicates()
 The  Predicatesobject contains onePredicateelement for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in aRateBasedRule. | 
| String | getMetricName()
 A friendly name or description for the metrics for a  RateBasedRule. | 
| String | getName()
 A friendly name or description for a  RateBasedRule. | 
| String | getRateKey()
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. | 
| Long | getRateLimit()
 The maximum number of requests, which have an identical value in the field specified by the  RateKey,
 allowed in a five-minute period. | 
| String | getRuleId()
 A unique identifier for a  RateBasedRule. | 
| int | hashCode() | 
| void | marshall(ProtocolMarshaller protocolMarshaller)Marshalls this structured data using the given  ProtocolMarshaller. | 
| void | setMatchPredicates(Collection<Predicate> matchPredicates)
 The  Predicatesobject contains onePredicateelement for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in aRateBasedRule. | 
| void | setMetricName(String metricName)
 A friendly name or description for the metrics for a  RateBasedRule. | 
| void | setName(String name)
 A friendly name or description for a  RateBasedRule. | 
| void | setRateKey(RateKey rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. | 
| void | setRateKey(String rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. | 
| void | setRateLimit(Long rateLimit)
 The maximum number of requests, which have an identical value in the field specified by the  RateKey,
 allowed in a five-minute period. | 
| void | setRuleId(String ruleId)
 A unique identifier for a  RateBasedRule. | 
| String | toString()Returns a string representation of this object. | 
| RateBasedRule | withMatchPredicates(Collection<Predicate> matchPredicates)
 The  Predicatesobject contains onePredicateelement for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in aRateBasedRule. | 
| RateBasedRule | withMatchPredicates(Predicate... matchPredicates)
 The  Predicatesobject contains onePredicateelement for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in aRateBasedRule. | 
| RateBasedRule | withMetricName(String metricName)
 A friendly name or description for the metrics for a  RateBasedRule. | 
| RateBasedRule | withName(String name)
 A friendly name or description for a  RateBasedRule. | 
| RateBasedRule | withRateKey(RateKey rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. | 
| RateBasedRule | withRateKey(String rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. | 
| RateBasedRule | withRateLimit(Long rateLimit)
 The maximum number of requests, which have an identical value in the field specified by the  RateKey,
 allowed in a five-minute period. | 
| RateBasedRule | withRuleId(String ruleId)
 A unique identifier for a  RateBasedRule. | 
public void setRuleId(String ruleId)
 A unique identifier for a RateBasedRule. You use RuleId to get more information about a
 RateBasedRule (see GetRateBasedRule), update a RateBasedRule (see
 UpdateRateBasedRule), insert a RateBasedRule into a WebACL or delete one from a
 WebACL (see UpdateWebACL), or delete a RateBasedRule from AWS WAF (see
 DeleteRateBasedRule).
 
ruleId - A unique identifier for a RateBasedRule. You use RuleId to get more information
        about a RateBasedRule (see GetRateBasedRule), update a RateBasedRule (see
        UpdateRateBasedRule), insert a RateBasedRule into a WebACL or delete one
        from a WebACL (see UpdateWebACL), or delete a RateBasedRule from AWS WAF
        (see DeleteRateBasedRule).public String getRuleId()
 A unique identifier for a RateBasedRule. You use RuleId to get more information about a
 RateBasedRule (see GetRateBasedRule), update a RateBasedRule (see
 UpdateRateBasedRule), insert a RateBasedRule into a WebACL or delete one from a
 WebACL (see UpdateWebACL), or delete a RateBasedRule from AWS WAF (see
 DeleteRateBasedRule).
 
RateBasedRule. You use RuleId to get more information
         about a RateBasedRule (see GetRateBasedRule), update a RateBasedRule
         (see UpdateRateBasedRule), insert a RateBasedRule into a WebACL or
         delete one from a WebACL (see UpdateWebACL), or delete a RateBasedRule
         from AWS WAF (see DeleteRateBasedRule).public RateBasedRule withRuleId(String ruleId)
 A unique identifier for a RateBasedRule. You use RuleId to get more information about a
 RateBasedRule (see GetRateBasedRule), update a RateBasedRule (see
 UpdateRateBasedRule), insert a RateBasedRule into a WebACL or delete one from a
 WebACL (see UpdateWebACL), or delete a RateBasedRule from AWS WAF (see
 DeleteRateBasedRule).
 
ruleId - A unique identifier for a RateBasedRule. You use RuleId to get more information
        about a RateBasedRule (see GetRateBasedRule), update a RateBasedRule (see
        UpdateRateBasedRule), insert a RateBasedRule into a WebACL or delete one
        from a WebACL (see UpdateWebACL), or delete a RateBasedRule from AWS WAF
        (see DeleteRateBasedRule).public void setName(String name)
 A friendly name or description for a RateBasedRule. You can't change the name of a
 RateBasedRule after you create it.
 
name - A friendly name or description for a RateBasedRule. You can't change the name of a
        RateBasedRule after you create it.public String getName()
 A friendly name or description for a RateBasedRule. You can't change the name of a
 RateBasedRule after you create it.
 
RateBasedRule. You can't change the name of a
         RateBasedRule after you create it.public RateBasedRule withName(String name)
 A friendly name or description for a RateBasedRule. You can't change the name of a
 RateBasedRule after you create it.
 
name - A friendly name or description for a RateBasedRule. You can't change the name of a
        RateBasedRule after you create it.public void setMetricName(String metricName)
 A friendly name or description for the metrics for a RateBasedRule. The name can contain only
 alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain
 whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change the name
 of the metric after you create the RateBasedRule.
 
metricName - A friendly name or description for the metrics for a RateBasedRule. The name can contain only
        alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain
        whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change
        the name of the metric after you create the RateBasedRule.public String getMetricName()
 A friendly name or description for the metrics for a RateBasedRule. The name can contain only
 alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain
 whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change the name
 of the metric after you create the RateBasedRule.
 
RateBasedRule. The name can contain
         only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't
         contain whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't
         change the name of the metric after you create the RateBasedRule.public RateBasedRule withMetricName(String metricName)
 A friendly name or description for the metrics for a RateBasedRule. The name can contain only
 alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain
 whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change the name
 of the metric after you create the RateBasedRule.
 
metricName - A friendly name or description for the metrics for a RateBasedRule. The name can contain only
        alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain
        whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change
        the name of the metric after you create the RateBasedRule.public List<Predicate> getMatchPredicates()
 The Predicates object contains one Predicate element for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in a RateBasedRule.
 
Predicates object contains one Predicate element for each
         ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in a
         RateBasedRule.public void setMatchPredicates(Collection<Predicate> matchPredicates)
 The Predicates object contains one Predicate element for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in a RateBasedRule.
 
matchPredicates - The Predicates object contains one Predicate element for each
        ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in a
        RateBasedRule.public RateBasedRule withMatchPredicates(Predicate... matchPredicates)
 The Predicates object contains one Predicate element for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in a RateBasedRule.
 
 NOTE: This method appends the values to the existing list (if any). Use
 setMatchPredicates(java.util.Collection) or withMatchPredicates(java.util.Collection) if you
 want to override the existing values.
 
matchPredicates - The Predicates object contains one Predicate element for each
        ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in a
        RateBasedRule.public RateBasedRule withMatchPredicates(Collection<Predicate> matchPredicates)
 The Predicates object contains one Predicate element for each ByteMatchSet,
 IPSet, or SqlInjectionMatchSet object that you want to include in a RateBasedRule.
 
matchPredicates - The Predicates object contains one Predicate element for each
        ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in a
        RateBasedRule.public void setRateKey(String rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. The only valid value for RateKey is IP. IP indicates that
 requests arriving from the same IP address are subject to the RateLimit that is specified in the
 RateBasedRule.
 
rateKey - The field that AWS WAF uses to determine if requests are likely arriving from single source and thus
        subject to rate monitoring. The only valid value for RateKey is IP.
        IP indicates that requests arriving from the same IP address are subject to the
        RateLimit that is specified in the RateBasedRule.RateKeypublic String getRateKey()
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. The only valid value for RateKey is IP. IP indicates that
 requests arriving from the same IP address are subject to the RateLimit that is specified in the
 RateBasedRule.
 
RateKey is IP.
         IP indicates that requests arriving from the same IP address are subject to the
         RateLimit that is specified in the RateBasedRule.RateKeypublic RateBasedRule withRateKey(String rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. The only valid value for RateKey is IP. IP indicates that
 requests arriving from the same IP address are subject to the RateLimit that is specified in the
 RateBasedRule.
 
rateKey - The field that AWS WAF uses to determine if requests are likely arriving from single source and thus
        subject to rate monitoring. The only valid value for RateKey is IP.
        IP indicates that requests arriving from the same IP address are subject to the
        RateLimit that is specified in the RateBasedRule.RateKeypublic void setRateKey(RateKey rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. The only valid value for RateKey is IP. IP indicates that
 requests arriving from the same IP address are subject to the RateLimit that is specified in the
 RateBasedRule.
 
rateKey - The field that AWS WAF uses to determine if requests are likely arriving from single source and thus
        subject to rate monitoring. The only valid value for RateKey is IP.
        IP indicates that requests arriving from the same IP address are subject to the
        RateLimit that is specified in the RateBasedRule.RateKeypublic RateBasedRule withRateKey(RateKey rateKey)
 The field that AWS WAF uses to determine if requests are likely arriving from single source and thus subject to
 rate monitoring. The only valid value for RateKey is IP. IP indicates that
 requests arriving from the same IP address are subject to the RateLimit that is specified in the
 RateBasedRule.
 
rateKey - The field that AWS WAF uses to determine if requests are likely arriving from single source and thus
        subject to rate monitoring. The only valid value for RateKey is IP.
        IP indicates that requests arriving from the same IP address are subject to the
        RateLimit that is specified in the RateBasedRule.RateKeypublic void setRateLimit(Long rateLimit)
 The maximum number of requests, which have an identical value in the field specified by the RateKey,
 allowed in a five-minute period. If the number of requests exceeds the RateLimit and the other
 predicates specified in the rule are also met, AWS WAF triggers the action that is specified for this rule.
 
rateLimit - The maximum number of requests, which have an identical value in the field specified by the
        RateKey, allowed in a five-minute period. If the number of requests exceeds the
        RateLimit and the other predicates specified in the rule are also met, AWS WAF triggers the
        action that is specified for this rule.public Long getRateLimit()
 The maximum number of requests, which have an identical value in the field specified by the RateKey,
 allowed in a five-minute period. If the number of requests exceeds the RateLimit and the other
 predicates specified in the rule are also met, AWS WAF triggers the action that is specified for this rule.
 
RateKey, allowed in a five-minute period. If the number of requests exceeds the
         RateLimit and the other predicates specified in the rule are also met, AWS WAF triggers the
         action that is specified for this rule.public RateBasedRule withRateLimit(Long rateLimit)
 The maximum number of requests, which have an identical value in the field specified by the RateKey,
 allowed in a five-minute period. If the number of requests exceeds the RateLimit and the other
 predicates specified in the rule are also met, AWS WAF triggers the action that is specified for this rule.
 
rateLimit - The maximum number of requests, which have an identical value in the field specified by the
        RateKey, allowed in a five-minute period. If the number of requests exceeds the
        RateLimit and the other predicates specified in the rule are also met, AWS WAF triggers the
        action that is specified for this rule.public String toString()
toString in class ObjectObject.toString()public RateBasedRule clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojoProtocolMarshaller.marshall in interface StructuredPojoprotocolMarshaller - Implementation of ProtocolMarshaller used to marshall this object's data.