Class AlertFactory

java.lang.Object
org.openspaces.admin.alert.AlertFactory

public class AlertFactory extends Object
A factory for constructing an alert instance to be fired by an alert bean.
Since:
8.0
Author:
Moran Avigdor
  • Constructor Details

  • Method Details

    • name

      public AlertFactory name(String name)
      Alert name - the name assigned to the alert.
    • description

      public AlertFactory description(String description)
      Description - a description of the alert.
    • timestamp

      public AlertFactory timestamp(long timestamp)
      Timestamp - the date and time the alert occurred. Timestamp is already set by the factory upon construction.
    • severity

      public AlertFactory severity(AlertSeverity severity)
      Severity - the defined severity of the alert.
    • status

      public AlertFactory status(AlertStatus status)
      Status - the status of this alert.
    • groupUid

      public AlertFactory groupUid(String groupUid)
      A group unique identifier representing the aggregation of alerts belonging to the same alert bean, for a specific component. The group contains the history of alerts from the first unresolved alert triggered until the alert is resolved.
    • componentUid

      public AlertFactory componentUid(String componentUid)
      Component UID - the unique identifier of the component associated with the alert.
    • componentDescription

      public AlertFactory componentDescription(String componentDescription)
      Component Description - the description of the component specified by the componentUid(String).
    • config

      public AlertFactory config(Map<String,String> properties)
      Set the configuration properties used to configure the alert bean.

      Copies all of the configuration properties from the specified map. Overrides any previously set configuration properties.

      Parameters:
      properties - the configuration properties of the alert bean.
    • properties

      public AlertFactory properties(Map<String,String> properties)
      Set any runtime properties which can be correlated with the appearance of this alert. It is useful to put CPU, Memory and GC metrics into the map as a basic set of attributes for ease of troubleshooting.

      Copies all of the properties from the specified map. Overrides any previously set properties.

      Parameters:
      properties - the properties of an alert bean.
      See Also:
    • putProperties

      public AlertFactory putProperties(Map<String,String> properties)
      Set any runtime properties which can be correlated with the appearance of this alert.

      A convenience method for adding properties to an already existing set of properties. Copies all of the properties from the specified map to this map.

      See Also:
    • putProperty

      public AlertFactory putProperty(String key, String value)
      Set any runtime property which can be correlated with the appearance of this alert.

      A convenience method for adding a single property to an already existing set of properties.

      See Also:
    • toAlert

      public Alert toAlert()
      Returns:
      the constructed alert
      Throws:
      AdminException - if required configurations were not set properly (groupUid(String), severity(AlertSeverity), status(AlertStatus))
    • create

      public Alert create()
      Returns:
      the constructed alert
      Throws:
      AdminException - if required configurations were not set properly (groupUid(String), severity(AlertSeverity), status(AlertStatus))