Package org.swisspush.gateleen.qos
Class QoSRule
- java.lang.Object
-
- org.swisspush.gateleen.qos.QoSRule
-
public class QoSRule extends java.lang.ObjectRepresents 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 voidaddAction(java.lang.String action)Adds an action.voidclearAction()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.DoublegetReject()Returns the ratio which indicates if the request should be rejected or not.java.util.regex.PatterngetUrlPattern()Returns a precompiled pattern for this rule.java.lang.DoublegetWarn()Returns the ratio which indicates if the request should be logged with a warning or not.booleanperformAction()Indicates if an action has to be performed or not.voidremoveAction(java.lang.String action)Removes the action.voidsetReject(java.lang.Double reject)Sets the ratio which indicates if the request should be rejected or not.voidsetWarn(java.lang.Double warn)Returns the ratio which indicates if the request should be logged with a warning or not.
-
-
-
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.
-
-