Interface AlertManager


public interface AlertManager
This class provides access to LiveView alert related functionality.
Since:
2.0
See Also:
  • Method Details

    • getAlertRules

      List<AlertRule> getAlertRules(String user) throws LiveViewException
      Gets all available alert rules from the server for the given user. A user name of "*" or null returns all users' alerts.

      If authentication is disabled, "user" is just an opaque string that is used as a key in setting and getting alerts. There is no validation or authentication done with or for this opaque string.

      If authentication is enabled when the alert was created, "user" was the currently signed in user when the alert was created.

      Blocks until all AlertRules are returned.

      Returns:
      all AlertRules from the server for the given user, or all rules if user is *
      Throws:
      LiveViewException - if there is a problem with the request or network issue
    • getAlertRule

      AlertRule getAlertRule(String guid) throws LiveViewException
      Gets the alert rule specified by the GUID.
      Parameters:
      guid - : Unique String identifier for the AlertRule}
      Returns:
      The AlertRule that matches the given guid.
      Throws:
      LiveViewException - if there is a problem with the request or network issue or the AlertRule is not found.
      Since:
      10.3
    • createAlertRule

      AlertRule createAlertRule()
      Creates a new alert rule. The returned object must be added to the server once configured for it to take effect.

      All of the properties of the returned AlertRule have initial values, but no initial value is guaranteed to be valid.

      After valid property values have been assigned, the rule can be added to the server using setAlertRule(AlertRule)

      Returns:
      a new AlertRule
      See Also:
    • setAlertRule

      AlertRule setAlertRule(AlertRule rule) throws LiveViewException
      Adds if it does not previously exist, or overwrites if it does (matching by id), the given alert rule onto the server.

      Only alert rules created via by createAlertRule() or retrieved by this manager may be added to the server via this method.

      If a new alert rule is being added, the given AlertRule is mutated on return such that its id is set.

      The owner of the alert rule is set to the username of the authenticated user if the authentication is enabled.

      Returns:
      the given AlertRule with the id set, if previously not set.
      Throws:
      LiveViewException - if there is a problem with the request or network issue
    • deleteAlertRule

      void deleteAlertRule(String guid) throws LiveViewException
      Deletes the AlertRule from the server that matches the given GUID. A LiveViewException is thrown if the rule doesn't exist on the server.
      Parameters:
      guid - : Unique String identifier for the AlertRule}.
      Throws:
      LiveViewException - if there is a problem with the request or network issue or no alert rule. can be found with the given guid.
      Since:
      10.3
    • validateAlertRule

      void validateAlertRule(AlertRule rule) throws LiveViewException
      Validates the given alert rule. A LiveViewException is thrown if the rule fails to validate properly.
      Parameters:
      rule - The AlertRule to validate against the currently running server
      Throws:
      LiveViewException - if there is a problem with the given rule
    • getKnownSettableAlertGroups

      Set<String> getKnownSettableAlertGroups() throws LiveViewException
      Gets all the alert groups that the server knows about that you have permission to set
      Returns:
      A list of alert groups that you have permission to set and that the server knows about.
      Throws:
      LiveViewException
      Since:
      10.5