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
IPSet
that causes AWS WAF to search for web requests that originate from the IP address192.0.2.44
- A
ByteMatchSet
that causes AWS WAF to search for web requests for which the value of theUser-Agent
header 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()
boolean
getName()
The friendly name or description for theRule
.ThePredicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.A unique identifier for aRule
.int
hashCode()
void
setMetricName
(String metricName) void
The friendly name or description for theRule
.void
setPredicates
(Collection<Predicate> predicates) ThePredicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.void
A 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) ThePredicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.withPredicates
(Collection<Predicate> predicates) ThePredicates
object contains onePredicate
element 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 useRuleId
to get more information about aRule
(see GetRule), update aRule
(see UpdateRule), insert aRule
into aWebACL
or delete a one from aWebACL
(see UpdateWebACL), or delete aRule
from AWS WAF (see DeleteRule).RuleId
is returned by CreateRule and by ListRules.- Parameters:
ruleId
- A unique identifier for aRule
. You useRuleId
to get more information about aRule
(see GetRule), update aRule
(see UpdateRule), insert aRule
into aWebACL
or delete a one from aWebACL
(see UpdateWebACL), or delete aRule
from AWS WAF (see DeleteRule).RuleId
is returned by CreateRule and by ListRules.
-
getRuleId
A unique identifier for a
Rule
. You useRuleId
to get more information about aRule
(see GetRule), update aRule
(see UpdateRule), insert aRule
into aWebACL
or delete a one from aWebACL
(see UpdateWebACL), or delete aRule
from AWS WAF (see DeleteRule).RuleId
is returned by CreateRule and by ListRules.- Returns:
- A unique identifier for a
Rule
. You useRuleId
to get more information about aRule
(see GetRule), update aRule
(see UpdateRule), insert aRule
into aWebACL
or delete a one from aWebACL
(see UpdateWebACL), or delete aRule
from AWS WAF (see DeleteRule).RuleId
is returned by CreateRule and by ListRules.
-
withRuleId
A unique identifier for a
Rule
. You useRuleId
to get more information about aRule
(see GetRule), update aRule
(see UpdateRule), insert aRule
into aWebACL
or delete a one from aWebACL
(see UpdateWebACL), or delete aRule
from AWS WAF (see DeleteRule).RuleId
is returned by CreateRule and by ListRules.- Parameters:
ruleId
- A unique identifier for aRule
. You useRuleId
to get more information about aRule
(see GetRule), update aRule
(see UpdateRule), insert aRule
into aWebACL
or delete a one from aWebACL
(see UpdateWebACL), or delete aRule
from AWS WAF (see DeleteRule).RuleId
is 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 aRule
after you create it.- Parameters:
name
- The friendly name or description for theRule
. You can't change the name of aRule
after you create it.
-
getName
The friendly name or description for the
Rule
. You can't change the name of aRule
after you create it.- Returns:
- The friendly name or description for the
Rule
. You can't change the name of aRule
after you create it.
-
withName
The friendly name or description for the
Rule
. You can't change the name of aRule
after you create it.- Parameters:
name
- The friendly name or description for theRule
. You can't change the name of aRule
after you create it.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMetricName
- Parameters:
metricName
-
-
getMetricName
- Returns:
-
withMetricName
- Parameters:
metricName
-- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getPredicates
The
Predicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.- Returns:
- The
Predicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.
-
setPredicates
The
Predicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.- Parameters:
predicates
- ThePredicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.
-
withPredicates
The
Predicates
object contains onePredicate
element 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
- ThePredicates
object contains onePredicate
element 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
Predicates
object contains onePredicate
element for each ByteMatchSet, IPSet, or SqlInjectionMatchSet object that you want to include in aRule
.- Parameters:
predicates
- ThePredicates
object contains onePredicate
element 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
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-