@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Rule extends Object implements Serializable, Cloneable, StructuredPojo
This is the latest version of AWS WAF, named AWS WAFV2, released in November, 2019. For information, including how to migrate your AWS WAF resources from the prior release, see the AWS WAF Developer Guide.
A single rule, which you can use in a WebACL or RuleGroup to identify web requests that you want to allow, block, or count. Each rule includes one top-level Statement that AWS WAF uses to identify matching web requests, and parameters that govern how AWS WAF handles them.
Constructor and Description |
---|
Rule() |
Modifier and Type | Method and Description |
---|---|
Rule |
clone() |
boolean |
equals(Object obj) |
RuleAction |
getAction()
The action that AWS WAF should take on a web request when it matches the rule's statement.
|
String |
getName()
A friendly name of the rule.
|
OverrideAction |
getOverrideAction()
The action to use to override the rule's
Action setting. |
Integer |
getPriority()
If you define more than one
Rule in a WebACL , AWS WAF evaluates each request against
the Rules in order based on the value of Priority . |
Statement |
getStatement()
The AWS WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.
|
VisibilityConfig |
getVisibilityConfig()
Defines and enables Amazon CloudWatch metrics and web request sample collection.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setAction(RuleAction action)
The action that AWS WAF should take on a web request when it matches the rule's statement.
|
void |
setName(String name)
A friendly name of the rule.
|
void |
setOverrideAction(OverrideAction overrideAction)
The action to use to override the rule's
Action setting. |
void |
setPriority(Integer priority)
If you define more than one
Rule in a WebACL , AWS WAF evaluates each request against
the Rules in order based on the value of Priority . |
void |
setStatement(Statement statement)
The AWS WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.
|
void |
setVisibilityConfig(VisibilityConfig visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
|
String |
toString()
Returns a string representation of this object.
|
Rule |
withAction(RuleAction action)
The action that AWS WAF should take on a web request when it matches the rule's statement.
|
Rule |
withName(String name)
A friendly name of the rule.
|
Rule |
withOverrideAction(OverrideAction overrideAction)
The action to use to override the rule's
Action setting. |
Rule |
withPriority(Integer priority)
If you define more than one
Rule in a WebACL , AWS WAF evaluates each request against
the Rules in order based on the value of Priority . |
Rule |
withStatement(Statement statement)
The AWS WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.
|
Rule |
withVisibilityConfig(VisibilityConfig visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
|
public void setName(String name)
A friendly name of the rule. You can't change the name of a Rule
after you create it.
name
- A friendly name of the rule. You can't change the name of a Rule
after you create it.public String getName()
A friendly name of the rule. You can't change the name of a Rule
after you create it.
Rule
after you create it.public Rule withName(String name)
A friendly name of the rule. You can't change the name of a Rule
after you create it.
name
- A friendly name of the rule. You can't change the name of a Rule
after you create it.public void setPriority(Integer priority)
If you define more than one Rule
in a WebACL
, AWS WAF evaluates each request against
the Rules
in order based on the value of Priority
. AWS WAF processes rules with lower
priority first. The priorities don't need to be consecutive, but they must all be different.
priority
- If you define more than one Rule
in a WebACL
, AWS WAF evaluates each request
against the Rules
in order based on the value of Priority
. AWS WAF processes
rules with lower priority first. The priorities don't need to be consecutive, but they must all be
different.public Integer getPriority()
If you define more than one Rule
in a WebACL
, AWS WAF evaluates each request against
the Rules
in order based on the value of Priority
. AWS WAF processes rules with lower
priority first. The priorities don't need to be consecutive, but they must all be different.
Rule
in a WebACL
, AWS WAF evaluates each request
against the Rules
in order based on the value of Priority
. AWS WAF processes
rules with lower priority first. The priorities don't need to be consecutive, but they must all be
different.public Rule withPriority(Integer priority)
If you define more than one Rule
in a WebACL
, AWS WAF evaluates each request against
the Rules
in order based on the value of Priority
. AWS WAF processes rules with lower
priority first. The priorities don't need to be consecutive, but they must all be different.
priority
- If you define more than one Rule
in a WebACL
, AWS WAF evaluates each request
against the Rules
in order based on the value of Priority
. AWS WAF processes
rules with lower priority first. The priorities don't need to be consecutive, but they must all be
different.public void setStatement(Statement statement)
The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
statement
- The AWS WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.public Statement getStatement()
The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
public Rule withStatement(Statement statement)
The AWS WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.
statement
- The AWS WAF processing statement for the rule, for example ByteMatchStatement or
SizeConstraintStatement.public void setAction(RuleAction action)
The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.
action
- The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the
web ACL level can override the rule action setting.public RuleAction getAction()
The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.
public Rule withAction(RuleAction action)
The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.
action
- The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the
web ACL level can override the rule action setting.public void setOverrideAction(OverrideAction overrideAction)
The action to use to override the rule's Action
setting. You can use no override action, in which
case the rule action is in effect, or count action, in which case, if the rule matches a web request, it only
counts the match.
overrideAction
- The action to use to override the rule's Action
setting. You can use no override action, in
which case the rule action is in effect, or count action, in which case, if the rule matches a web
request, it only counts the match.public OverrideAction getOverrideAction()
The action to use to override the rule's Action
setting. You can use no override action, in which
case the rule action is in effect, or count action, in which case, if the rule matches a web request, it only
counts the match.
Action
setting. You can use no override action, in
which case the rule action is in effect, or count action, in which case, if the rule matches a web
request, it only counts the match.public Rule withOverrideAction(OverrideAction overrideAction)
The action to use to override the rule's Action
setting. You can use no override action, in which
case the rule action is in effect, or count action, in which case, if the rule matches a web request, it only
counts the match.
overrideAction
- The action to use to override the rule's Action
setting. You can use no override action, in
which case the rule action is in effect, or count action, in which case, if the rule matches a web
request, it only counts the match.public void setVisibilityConfig(VisibilityConfig visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
visibilityConfig
- Defines and enables Amazon CloudWatch metrics and web request sample collection.public VisibilityConfig getVisibilityConfig()
Defines and enables Amazon CloudWatch metrics and web request sample collection.
public Rule withVisibilityConfig(VisibilityConfig visibilityConfig)
Defines and enables Amazon CloudWatch metrics and web request sample collection.
visibilityConfig
- Defines and enables Amazon CloudWatch metrics and web request sample collection.public String toString()
toString
in class Object
Object.toString()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.