public class Rule extends Object implements 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:
IPSet that causes AWS WAF to search for web requests that
originate from the IP address 192.0.2.44ByteMatchSet that causes AWS WAF to search for web
requests for which the value of the User-Agent header is
BadBot.
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.
| Constructor and Description |
|---|
Rule() |
| Modifier and Type | Method and Description |
|---|---|
Rule |
clone() |
boolean |
equals(Object obj) |
String |
getMetricName() |
String |
getName()
The friendly name or description for the
Rule. |
List<Predicate> |
getPredicates()
The
Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule. |
String |
getRuleId()
A unique identifier for a
Rule. |
int |
hashCode() |
void |
setMetricName(String metricName) |
void |
setName(String name)
The friendly name or description for the
Rule. |
void |
setPredicates(Collection<Predicate> predicates)
The
Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule. |
void |
setRuleId(String ruleId)
A unique identifier for a
Rule. |
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Rule |
withMetricName(String metricName) |
Rule |
withName(String name)
The friendly name or description for the
Rule. |
Rule |
withPredicates(Collection<Predicate> predicates)
The
Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule. |
Rule |
withPredicates(Predicate... predicates)
The
Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule. |
Rule |
withRuleId(String ruleId)
A unique identifier for a
Rule. |
public void setRuleId(String ruleId)
A unique identifier for a Rule. You use RuleId
to get more information about a Rule (see GetRule),
update a Rule (see UpdateRule), insert a
Rule into a WebACL or delete a one from a
WebACL (see UpdateWebACL), or delete a
Rule from AWS WAF (see DeleteRule).
RuleId is returned by CreateRule and by
ListRules.
ruleId - A unique identifier for a Rule. You use
RuleId to get more information about a
Rule (see GetRule), update a Rule
(see UpdateRule), insert a Rule into a
WebACL or delete a one from a WebACL
(see UpdateWebACL), or delete a Rule from AWS
WAF (see DeleteRule).
RuleId is returned by CreateRule and by
ListRules.
public String getRuleId()
A unique identifier for a Rule. You use RuleId
to get more information about a Rule (see GetRule),
update a Rule (see UpdateRule), insert a
Rule into a WebACL or delete a one from a
WebACL (see UpdateWebACL), or delete a
Rule from AWS WAF (see DeleteRule).
RuleId is returned by CreateRule and by
ListRules.
Rule. You use
RuleId to get more information about a
Rule (see GetRule), update a
Rule (see UpdateRule), insert a
Rule into a WebACL or delete a one from
a WebACL (see UpdateWebACL), or delete a
Rule from AWS WAF (see DeleteRule).
RuleId is returned by CreateRule and by
ListRules.
public Rule withRuleId(String ruleId)
A unique identifier for a Rule. You use RuleId
to get more information about a Rule (see GetRule),
update a Rule (see UpdateRule), insert a
Rule into a WebACL or delete a one from a
WebACL (see UpdateWebACL), or delete a
Rule from AWS WAF (see DeleteRule).
RuleId is returned by CreateRule and by
ListRules.
ruleId - A unique identifier for a Rule. You use
RuleId to get more information about a
Rule (see GetRule), update a Rule
(see UpdateRule), insert a Rule into a
WebACL or delete a one from a WebACL
(see UpdateWebACL), or delete a Rule from AWS
WAF (see DeleteRule).
RuleId is returned by CreateRule and by
ListRules.
public void setName(String name)
The friendly name or description for the Rule. You can't
change the name of a Rule after you create it.
name - The friendly name or description for the Rule. You
can't change the name of a Rule after you create it.public String getName()
The friendly name or description for the Rule. You can't
change the name of a Rule after you create it.
Rule. You
can't change the name of a Rule after you create it.public Rule withName(String name)
The friendly name or description for the Rule. You can't
change the name of a Rule after you create it.
name - The friendly name or description for the Rule. You
can't change the name of a Rule after you create it.public void setMetricName(String metricName)
metricName - public String getMetricName()
public Rule withMetricName(String metricName)
metricName - public List<Predicate> getPredicates()
The Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule.
Predicates object contains one
Predicate element for each ByteMatchSet,
IPSet, or SqlInjectionMatchSet object that you want
to include in a Rule.public void setPredicates(Collection<Predicate> predicates)
The Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule.
predicates - The Predicates object contains one
Predicate element for each ByteMatchSet,
IPSet, or SqlInjectionMatchSet object that you want
to include in a Rule.public Rule withPredicates(Predicate... predicates)
The Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule.
NOTE: This method appends the values to the existing list (if
any). Use setPredicates(java.util.Collection) or
withPredicates(java.util.Collection) if you want to override the
existing values.
predicates - The Predicates object contains one
Predicate element for each ByteMatchSet,
IPSet, or SqlInjectionMatchSet object that you want
to include in a Rule.public Rule withPredicates(Collection<Predicate> predicates)
The Predicates object contains one Predicate
element for each ByteMatchSet, IPSet, or
SqlInjectionMatchSet object that you want to include in a
Rule.
predicates - The Predicates object contains one
Predicate element for each ByteMatchSet,
IPSet, or SqlInjectionMatchSet object that you want
to include in a Rule.public String toString()
toString in class ObjectObject.toString()Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.