Class AlertSampleManager.Threshold
java.lang.Object
org.ametys.runtime.plugins.admin.jvmstatus.monitoring.alerts.AlertSampleManager.Threshold
- Enclosing interface:
- AlertSampleManager
Represents a threshold
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The possible types of operators -
Constructor Summary
ConstructorDescriptionThreshold
(AlertSampleManager.Threshold.Operator operator, String datasourceName, Object value, I18nizableText mailSubject, I18nizableText mailBody) Creates a threshold. -
Method Summary
Modifier and TypeMethodDescriptionGets the datasource name of this threshold.Gets the body of the mail to send.Gets the subject of the mail to send.getValue()
Gets the value of the threshold.boolean
isExceeded
(Object comparedTo) Tests if the given value exceeds the threshold.
-
Constructor Details
-
Threshold
public Threshold(AlertSampleManager.Threshold.Operator operator, String datasourceName, Object value, I18nizableText mailSubject, I18nizableText mailBody) Creates a threshold.- Parameters:
operator
- The kind of operatordatasourceName
- The id of the datasourcevalue
- The value of the threshold. Can be null to disable the alert.mailSubject
- The subject of the potential mail to send.mailBody
- The body of the potential mail to send.
-
-
Method Details
-
getDatasourceName
Gets the datasource name of this threshold.- Returns:
- the datasource name.
-
getValue
Gets the value of the threshold.- Returns:
- the value of the threshold.
-
getMailSubject
Gets the subject of the mail to send.- Returns:
- the subject of the mail to send.
-
getMailBody
Gets the body of the mail to send.- Returns:
- the body of the mail to send.
-
isExceeded
Tests if the given value exceeds the threshold.- Parameters:
comparedTo
- The value to test against the threshold.- Returns:
- true if it exceeded, false otherwise.
-