Class AlertSampleManager.Threshold
- java.lang.Object
-
- org.ametys.runtime.plugins.admin.jvmstatus.monitoring.alerts.AlertSampleManager.Threshold
-
- Enclosing interface:
- AlertSampleManager
public static class AlertSampleManager.Threshold extends Object
Represents a threshold
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AlertSampleManager.Threshold.Operator
The possible types of operators
-
Field Summary
Fields Modifier and Type Field Description private String
_dsName
private I18nizableText
_mailBody
private I18nizableText
_mailSubject
private AlertSampleManager.Threshold.Operator
_operator
private Object
_value
-
Constructor Summary
Constructors Constructor Description Threshold(AlertSampleManager.Threshold.Operator operator, String datasourceName, Object value, I18nizableText mailSubject, I18nizableText mailBody)
Creates a threshold.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDatasourceName()
Gets the datasource name of this threshold.I18nizableText
getMailBody()
Gets the body of the mail to send.I18nizableText
getMailSubject()
Gets the subject of the mail to send.Object
getValue()
Gets the value of the threshold.boolean
isExceeded(Object comparedTo)
Tests if the given value exceeds the threshold.
-
-
-
Field Detail
-
_operator
private AlertSampleManager.Threshold.Operator _operator
-
_mailSubject
private I18nizableText _mailSubject
-
_mailBody
private I18nizableText _mailBody
-
-
Constructor Detail
-
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 Detail
-
getDatasourceName
public String getDatasourceName()
Gets the datasource name of this threshold.- Returns:
- the datasource name.
-
getValue
public Object getValue()
Gets the value of the threshold.- Returns:
- the value of the threshold.
-
getMailSubject
public I18nizableText getMailSubject()
Gets the subject of the mail to send.- Returns:
- the subject of the mail to send.
-
getMailBody
public I18nizableText getMailBody()
Gets the body of the mail to send.- Returns:
- the body of the mail to send.
-
isExceeded
public boolean isExceeded(Object comparedTo)
Tests if the given value exceeds the threshold.- Parameters:
comparedTo
- The value to test against the threshold.- Returns:
- true if it exceeded, false otherwise.
-
-