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
Rulesthat identify the requests that you want to allow, block, or count. In aWebACL, you also specify a default action (ALLOWorBLOCK), and the action for eachRulethat you add to aWebACL, for example, block requests from specified IP addresses or block requests from specified referrers. You also associate theWebACLwith a CloudFront distribution to identify the requests that you want AWS WAF to filter. If you add more than oneRuleto 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 WebACLclone()booleanequals(Object obj)WafActiongetDefaultAction()The action to perform if none of theRulescontained in theWebACLmatch.StringgetMetricName()StringgetName()A friendly name or description of theWebACL.List<ActivatedRule>getRules()An array that contains the action for eachRulein aWebACL, the priority of theRule, and the ID of theRule.StringgetWebACLId()A unique identifier for aWebACL.inthashCode()voidsetDefaultAction(WafAction defaultAction)The action to perform if none of theRulescontained in theWebACLmatch.voidsetMetricName(String metricName)voidsetName(String name)A friendly name or description of theWebACL.voidsetRules(Collection<ActivatedRule> rules)An array that contains the action for eachRulein aWebACL, the priority of theRule, and the ID of theRule.voidsetWebACLId(String webACLId)A unique identifier for aWebACL.StringtoString()Returns a string representation of this object; useful for testing and debugging.WebACLwithDefaultAction(WafAction defaultAction)The action to perform if none of theRulescontained in theWebACLmatch.WebACLwithMetricName(String metricName)WebACLwithName(String name)A friendly name or description of theWebACL.WebACLwithRules(ActivatedRule... rules)An array that contains the action for eachRulein aWebACL, the priority of theRule, and the ID of theRule.WebACLwithRules(Collection<ActivatedRule> rules)An array that contains the action for eachRulein aWebACL, the priority of theRule, and the ID of theRule.WebACLwithWebACLId(String webACLId)A unique identifier for aWebACL.
-
-
-
Method Detail
-
setWebACLId
public void setWebACLId(String webACLId)
A unique identifier for a
WebACL. You useWebACLIdto get information about aWebACL(see GetWebACL), update aWebACL(see UpdateWebACL), and delete aWebACLfrom AWS WAF (see DeleteWebACL).WebACLIdis returned by CreateWebACL and by ListWebACLs.- Parameters:
webACLId- A unique identifier for aWebACL. You useWebACLIdto get information about aWebACL(see GetWebACL), update aWebACL(see UpdateWebACL), and delete aWebACLfrom AWS WAF (see DeleteWebACL).WebACLIdis returned by CreateWebACL and by ListWebACLs.
-
getWebACLId
public String getWebACLId()
A unique identifier for a
WebACL. You useWebACLIdto get information about aWebACL(see GetWebACL), update aWebACL(see UpdateWebACL), and delete aWebACLfrom AWS WAF (see DeleteWebACL).WebACLIdis returned by CreateWebACL and by ListWebACLs.- Returns:
- A unique identifier for a
WebACL. You useWebACLIdto get information about aWebACL(see GetWebACL), update aWebACL(see UpdateWebACL), and delete aWebACLfrom AWS WAF (see DeleteWebACL).WebACLIdis returned by CreateWebACL and by ListWebACLs.
-
withWebACLId
public WebACL withWebACLId(String webACLId)
A unique identifier for a
WebACL. You useWebACLIdto get information about aWebACL(see GetWebACL), update aWebACL(see UpdateWebACL), and delete aWebACLfrom AWS WAF (see DeleteWebACL).WebACLIdis returned by CreateWebACL and by ListWebACLs.- Parameters:
webACLId- A unique identifier for aWebACL. You useWebACLIdto get information about aWebACL(see GetWebACL), update aWebACL(see UpdateWebACL), and delete aWebACLfrom AWS WAF (see DeleteWebACL).WebACLIdis 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 aWebACLafter you create it.- Parameters:
name- A friendly name or description of theWebACL. You can't change the name of aWebACLafter you create it.
-
getName
public String getName()
A friendly name or description of the
WebACL. You can't change the name of aWebACLafter you create it.- Returns:
- A friendly name or description of the
WebACL. You can't change the name of aWebACLafter you create it.
-
withName
public WebACL withName(String name)
A friendly name or description of the
WebACL. You can't change the name of aWebACLafter you create it.- Parameters:
name- A friendly name or description of theWebACL. You can't change the name of aWebACLafter 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
Rulescontained in theWebACLmatch. The action is specified by the WafAction object.- Parameters:
defaultAction- The action to perform if none of theRulescontained in theWebACLmatch. The action is specified by the WafAction object.
-
getDefaultAction
public WafAction getDefaultAction()
The action to perform if none of the
Rulescontained in theWebACLmatch. The action is specified by the WafAction object.- Returns:
- The action to perform if none of the
Rulescontained in theWebACLmatch. The action is specified by the WafAction object.
-
withDefaultAction
public WebACL withDefaultAction(WafAction defaultAction)
The action to perform if none of the
Rulescontained in theWebACLmatch. The action is specified by the WafAction object.- Parameters:
defaultAction- The action to perform if none of theRulescontained in theWebACLmatch. 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
Rulein aWebACL, the priority of theRule, and the ID of theRule.- Returns:
- An array that contains the action for each
Rulein 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
Rulein aWebACL, the priority of theRule, and the ID of theRule.- Parameters:
rules- An array that contains the action for eachRulein aWebACL, the priority of theRule, and the ID of theRule.
-
withRules
public WebACL withRules(ActivatedRule... rules)
An array that contains the action for each
Rulein 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 eachRulein 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
Rulein aWebACL, the priority of theRule, and the ID of theRule.- Parameters:
rules- An array that contains the action for eachRulein 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:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-