Class QoSRule


  • public class QoSRule
    extends Object
    Represents a rule for the QoS Handler.
    Author:
    https://github.com/ljucam [Mario Ljuca]
    • Constructor Detail

      • QoSRule

        public QoSRule​(Pattern urlPattern)
        Creates a new QoS rule object with the given pattern.
        Parameters:
        urlPattern - the url pattern for this rule
    • Method Detail

      • getReject

        public Double getReject()
        Returns the ratio which indicates if the request should be rejected or not.
        Returns:
        the ratio
      • setReject

        public void setReject​(Double reject)
        Sets the ratio which indicates if the request should be rejected or not.
        Parameters:
        reject - the ratio
      • getWarn

        public Double getWarn()
        Returns the ratio which indicates if the request should be logged with a warning or not.
        Returns:
        the ratio
      • setWarn

        public void setWarn​(Double warn)
        Returns the ratio which indicates if the request should be logged with a warning or not.
        Parameters:
        warn - the ratio
      • getUrlPattern

        public Pattern getUrlPattern()
        Returns a precompiled pattern for this rule.
        Returns:
        precompiled pattern
      • performAction

        public boolean performAction()
        Indicates if an action has to be performed or not.
        Returns:
        true if an action has to be performed, otherwise false
      • getActions

        public List<String> getActions()
        Returns a list of actions which hase to be performed.
        Returns:
        a list of actions which have to be performed
      • addAction

        public void addAction​(String action)
        Adds an action.
        Parameters:
        action - the action
      • removeAction

        public void removeAction​(String action)
        Removes the action.
        Parameters:
        action - the action
      • clearAction

        public void clearAction()
        Removes all actions for this rule.