Class QoSRule


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

      Constructors 
      Constructor Description
      QoSRule​(java.util.regex.Pattern urlPattern)
      Creates a new QoS rule object with the given pattern.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAction​(java.lang.String action)
      Adds an action.
      void clearAction()
      Removes all actions for this rule.
      java.util.List<java.lang.String> getActions()
      Returns a list of actions which hase to be performed.
      java.lang.Double getReject()
      Returns the ratio which indicates if the request should be rejected or not.
      java.util.regex.Pattern getUrlPattern()
      Returns a precompiled pattern for this rule.
      java.lang.Double getWarn()
      Returns the ratio which indicates if the request should be logged with a warning or not.
      boolean performAction()
      Indicates if an action has to be performed or not.
      void removeAction​(java.lang.String action)
      Removes the action.
      void setReject​(java.lang.Double reject)
      Sets the ratio which indicates if the request should be rejected or not.
      void setWarn​(java.lang.Double warn)
      Returns the ratio which indicates if the request should be logged with a warning or not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QoSRule

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

      • getReject

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

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

        public java.lang.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​(java.lang.Double warn)
        Returns the ratio which indicates if the request should be logged with a warning or not.
        Parameters:
        warn - the ratio
      • getUrlPattern

        public java.util.regex.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 java.util.List<java.lang.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​(java.lang.String action)
        Adds an action.
        Parameters:
        action - the action
      • removeAction

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

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