Class Rule
- All Implemented Interfaces:
Serializable, Cloneable
A combination of ByteMatchSet, IPSet, and/or
SqlInjectionMatchSet objects that identify the web requests that you
want to allow, block, or count. For example, you might create a
Rule that includes the following predicates:
- An
IPSetthat causes AWS WAF to search for web requests that originate from the IP address192.0.2.44 - A
ByteMatchSetthat causes AWS WAF to search for web requests for which the value of theUser-Agentheader isBadBot.
To match the settings in this Rule, a request must originate
from 192.0.2.44 AND include a User-Agent header for
which the value is BadBot.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleangetName()The friendly name or description for theRule.ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.A unique identifier for aRule.inthashCode()voidsetMetricName(String metricName) voidThe friendly name or description for theRule.voidsetPredicates(Collection<Predicate> predicates) ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.voidA unique identifier for aRule.toString()Returns a string representation of this object; useful for testing and debugging.withMetricName(String metricName) The friendly name or description for theRule.withPredicates(Predicate... predicates) ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.withPredicates(Collection<Predicate> predicates) ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.withRuleId(String ruleId) A unique identifier for aRule.
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
setRuleId
A unique identifier for a
Rule. You useRuleIdto get more information about aRule(see GetRule), update aRule(see UpdateRule), insert aRuleinto aWebACLor delete a one from aWebACL(see UpdateWebACL), or delete aRulefrom AWS WAF (see DeleteRule).RuleIdis returned by CreateRule and by ListRules.- Parameters:
ruleId- A unique identifier for aRule. You useRuleIdto get more information about aRule(see GetRule), update aRule(see UpdateRule), insert aRuleinto aWebACLor delete a one from aWebACL(see UpdateWebACL), or delete aRulefrom AWS WAF (see DeleteRule).RuleIdis returned by CreateRule and by ListRules.
-
getRuleId
A unique identifier for a
Rule. You useRuleIdto get more information about aRule(see GetRule), update aRule(see UpdateRule), insert aRuleinto aWebACLor delete a one from aWebACL(see UpdateWebACL), or delete aRulefrom AWS WAF (see DeleteRule).RuleIdis returned by CreateRule and by ListRules.- Returns:
- A unique identifier for a
Rule. You useRuleIdto get more information about aRule(see GetRule), update aRule(see UpdateRule), insert aRuleinto aWebACLor delete a one from aWebACL(see UpdateWebACL), or delete aRulefrom AWS WAF (see DeleteRule).RuleIdis returned by CreateRule and by ListRules.
-
withRuleId
A unique identifier for a
Rule. You useRuleIdto get more information about aRule(see GetRule), update aRule(see UpdateRule), insert aRuleinto aWebACLor delete a one from aWebACL(see UpdateWebACL), or delete aRulefrom AWS WAF (see DeleteRule).RuleIdis returned by CreateRule and by ListRules.- Parameters:
ruleId- A unique identifier for aRule. You useRuleIdto get more information about aRule(see GetRule), update aRule(see UpdateRule), insert aRuleinto aWebACLor delete a one from aWebACL(see UpdateWebACL), or delete aRulefrom AWS WAF (see DeleteRule).RuleIdis returned by CreateRule and by ListRules.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setName
The friendly name or description for the
Rule. You can't change the name of aRuleafter you create it.- Parameters:
name- The friendly name or description for theRule. You can't change the name of aRuleafter you create it.
-
getName
The friendly name or description for the
Rule. You can't change the name of aRuleafter you create it.- Returns:
- The friendly name or description for the
Rule. You can't change the name of aRuleafter you create it.
-
withName
The friendly name or description for the
Rule. You can't change the name of aRuleafter you create it.- Parameters:
name- The friendly name or description for theRule. You can't change the name of aRuleafter you create it.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMetricName
- Parameters:
metricName-
-
getMetricName
- Returns:
-
withMetricName
-
getPredicates
The
Predicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.- Returns:
- The
Predicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.
-
setPredicates
The
Predicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.- Parameters:
predicates- ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.
-
withPredicates
The
Predicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.NOTE: This method appends the values to the existing list (if any). Use
setPredicates(java.util.Collection)orwithPredicates(java.util.Collection)if you want to override the existing values.- Parameters:
predicates- ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withPredicates
The
Predicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.- Parameters:
predicates- ThePredicatesobject contains onePredicateelement for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
-
equals
-
hashCode
-
clone
-