Class CustomRule

  • Direct Known Subclasses:
    RateLimitRule

    public class CustomRule
    extends Object
    Defines the common attributes for a custom rule that can be included in a waf policy.
    • Constructor Detail

      • CustomRule

        public CustomRule()
    • Method Detail

      • name

        public String name()
        Get the name property: Defines the name of the custom rule.
        Returns:
        the name value.
      • withName

        public CustomRule withName​(String name)
        Set the name property: Defines the name of the custom rule.
        Parameters:
        name - the name value to set.
        Returns:
        the CustomRule object itself.
      • enabledState

        public CustomRuleEnabledState enabledState()
        Get the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
        Returns:
        the enabledState value.
      • withEnabledState

        public CustomRule withEnabledState​(CustomRuleEnabledState enabledState)
        Set the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
        Parameters:
        enabledState - the enabledState value to set.
        Returns:
        the CustomRule object itself.
      • priority

        public int priority()
        Get the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.
        Returns:
        the priority value.
      • withPriority

        public CustomRule withPriority​(int priority)
        Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.
        Parameters:
        priority - the priority value to set.
        Returns:
        the CustomRule object itself.
      • matchConditions

        public List<MatchCondition> matchConditions()
        Get the matchConditions property: List of match conditions.
        Returns:
        the matchConditions value.
      • withMatchConditions

        public CustomRule withMatchConditions​(List<MatchCondition> matchConditions)
        Set the matchConditions property: List of match conditions.
        Parameters:
        matchConditions - the matchConditions value to set.
        Returns:
        the CustomRule object itself.
      • action

        public ActionType action()
        Get the action property: Describes what action to be applied when rule matches.
        Returns:
        the action value.
      • withAction

        public CustomRule withAction​(ActionType action)
        Set the action property: Describes what action to be applied when rule matches.
        Parameters:
        action - the action value to set.
        Returns:
        the CustomRule object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.