Class WebACL
- java.lang.Object
-
- com.amazonaws.services.waf.model.WebACL
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class WebACL extends Object implements Serializable, Cloneable
Contains the
Rules
that identify the requests that you want to allow, block, or count. In aWebACL
, you also specify a default action (ALLOW
orBLOCK
), and the action for eachRule
that you add to aWebACL
, for example, block requests from specified IP addresses or block requests from specified referrers. You also associate theWebACL
with a CloudFront distribution to identify the requests that you want AWS WAF to filter. If you add more than oneRule
to aWebACL
, a request needs to match only one of the specifications to be allowed, blocked, or counted. For more information, see UpdateWebACL.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebACL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebACL
clone()
boolean
equals(Object obj)
WafAction
getDefaultAction()
The action to perform if none of theRules
contained in theWebACL
match.String
getMetricName()
String
getName()
A friendly name or description of theWebACL
.List<ActivatedRule>
getRules()
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.String
getWebACLId()
A unique identifier for aWebACL
.int
hashCode()
void
setDefaultAction(WafAction defaultAction)
The action to perform if none of theRules
contained in theWebACL
match.void
setMetricName(String metricName)
void
setName(String name)
A friendly name or description of theWebACL
.void
setRules(Collection<ActivatedRule> rules)
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.void
setWebACLId(String webACLId)
A unique identifier for aWebACL
.String
toString()
Returns a string representation of this object; useful for testing and debugging.WebACL
withDefaultAction(WafAction defaultAction)
The action to perform if none of theRules
contained in theWebACL
match.WebACL
withMetricName(String metricName)
WebACL
withName(String name)
A friendly name or description of theWebACL
.WebACL
withRules(ActivatedRule... rules)
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.WebACL
withRules(Collection<ActivatedRule> rules)
An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.WebACL
withWebACLId(String webACLId)
A unique identifier for aWebACL
.
-
-
-
Method Detail
-
setWebACLId
public void setWebACLId(String webACLId)
A unique identifier for a
WebACL
. You useWebACLId
to get information about aWebACL
(see GetWebACL), update aWebACL
(see UpdateWebACL), and delete aWebACL
from AWS WAF (see DeleteWebACL).WebACLId
is returned by CreateWebACL and by ListWebACLs.- Parameters:
webACLId
- A unique identifier for aWebACL
. You useWebACLId
to get information about aWebACL
(see GetWebACL), update aWebACL
(see UpdateWebACL), and delete aWebACL
from AWS WAF (see DeleteWebACL).WebACLId
is returned by CreateWebACL and by ListWebACLs.
-
getWebACLId
public String getWebACLId()
A unique identifier for a
WebACL
. You useWebACLId
to get information about aWebACL
(see GetWebACL), update aWebACL
(see UpdateWebACL), and delete aWebACL
from AWS WAF (see DeleteWebACL).WebACLId
is returned by CreateWebACL and by ListWebACLs.- Returns:
- A unique identifier for a
WebACL
. You useWebACLId
to get information about aWebACL
(see GetWebACL), update aWebACL
(see UpdateWebACL), and delete aWebACL
from AWS WAF (see DeleteWebACL).WebACLId
is returned by CreateWebACL and by ListWebACLs.
-
withWebACLId
public WebACL withWebACLId(String webACLId)
A unique identifier for a
WebACL
. You useWebACLId
to get information about aWebACL
(see GetWebACL), update aWebACL
(see UpdateWebACL), and delete aWebACL
from AWS WAF (see DeleteWebACL).WebACLId
is returned by CreateWebACL and by ListWebACLs.- Parameters:
webACLId
- A unique identifier for aWebACL
. You useWebACLId
to get information about aWebACL
(see GetWebACL), update aWebACL
(see UpdateWebACL), and delete aWebACL
from AWS WAF (see DeleteWebACL).WebACLId
is returned by CreateWebACL and by ListWebACLs.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setName
public void setName(String name)
A friendly name or description of the
WebACL
. You can't change the name of aWebACL
after you create it.- Parameters:
name
- A friendly name or description of theWebACL
. You can't change the name of aWebACL
after you create it.
-
getName
public String getName()
A friendly name or description of the
WebACL
. You can't change the name of aWebACL
after you create it.- Returns:
- A friendly name or description of the
WebACL
. You can't change the name of aWebACL
after you create it.
-
withName
public WebACL withName(String name)
A friendly name or description of the
WebACL
. You can't change the name of aWebACL
after you create it.- Parameters:
name
- A friendly name or description of theWebACL
. You can't change the name of aWebACL
after you create it.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMetricName
public void setMetricName(String metricName)
- Parameters:
metricName
-
-
getMetricName
public String getMetricName()
- Returns:
-
withMetricName
public WebACL withMetricName(String metricName)
- Parameters:
metricName
-- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDefaultAction
public void setDefaultAction(WafAction defaultAction)
The action to perform if none of the
Rules
contained in theWebACL
match. The action is specified by the WafAction object.- Parameters:
defaultAction
- The action to perform if none of theRules
contained in theWebACL
match. The action is specified by the WafAction object.
-
getDefaultAction
public WafAction getDefaultAction()
The action to perform if none of the
Rules
contained in theWebACL
match. The action is specified by the WafAction object.- Returns:
- The action to perform if none of the
Rules
contained in theWebACL
match. The action is specified by the WafAction object.
-
withDefaultAction
public WebACL withDefaultAction(WafAction defaultAction)
The action to perform if none of the
Rules
contained in theWebACL
match. The action is specified by the WafAction object.- Parameters:
defaultAction
- The action to perform if none of theRules
contained in theWebACL
match. The action is specified by the WafAction object.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getRules
public List<ActivatedRule> getRules()
An array that contains the action for each
Rule
in aWebACL
, the priority of theRule
, and the ID of theRule
.- Returns:
- An array that contains the action for each
Rule
in aWebACL
, the priority of theRule
, and the ID of theRule
.
-
setRules
public void setRules(Collection<ActivatedRule> rules)
An array that contains the action for each
Rule
in aWebACL
, the priority of theRule
, and the ID of theRule
.- Parameters:
rules
- An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.
-
withRules
public WebACL withRules(ActivatedRule... rules)
An array that contains the action for each
Rule
in aWebACL
, the priority of theRule
, and the ID of theRule
.NOTE: This method appends the values to the existing list (if any). Use
setRules(java.util.Collection)
orwithRules(java.util.Collection)
if you want to override the existing values.- Parameters:
rules
- An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withRules
public WebACL withRules(Collection<ActivatedRule> rules)
An array that contains the action for each
Rule
in aWebACL
, the priority of theRule
, and the ID of theRule
.- Parameters:
rules
- An array that contains the action for eachRule
in aWebACL
, the priority of theRule
, and the ID of theRule
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-