com.streambase.liveview.client.alert

## Interface AlertManager

-     public interface AlertManager

  This class provides access to LiveView alert related functionality.
  Since:
    2.0
  See Also:
    `AlertRule`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `AlertRule` | `createAlertRule()` Creates a new alert rule.
    `void` | `deleteAlertRule(Long id)` Deprecated. : Use `AlertManager.deleteAlertRule(String)` instead.
    `void` | `deleteAlertRule(String guid)` Deletes the `AlertRule` from the server that matches the given GUID.
    `AlertRule` | `getAlertRule(long alertID)` Deprecated. : Use `AlertManager.getAlertRule(String)` instead.
    `AlertRule` | `getAlertRule(String guid)` Gets the alert rule specified by the GUID.
    `List<AlertRule>` | `getAlertRules(String user)` Gets all available alert rules from the server for the given user.
    `AlertRule` | `setAlertRule(AlertRule rule)` Adds if it does not previously exist, or overwrites if it does (matching by id), the given alert rule onto the server.
    `void` | `validateAlertRule(AlertRule rule)` Validates the given alert rule.

- - ### Method Detail

    - #### 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 `AlertRule`s 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

          @Deprecated
          AlertRule getAlertRule(long alertID)
                                       throws LiveViewException

      Deprecated. : Use `AlertManager.getAlertRule(String)` instead.
      Gets the alert rule specified by the ID.
      Parameters:
        `alertID` - : Unique long identifier for the `AlertRule`.
      Returns:
        the `AlertRule` that matches the given legacy alertID.
      Throws:
        `LiveViewException` - if there is a problem with the request or network issue or the `AlertRule` is not found.

    - #### 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 `AlertManager.setAlertRule(AlertRule)`

      Returns:
        a new `AlertRule`
      See Also:
        `AlertManager.setAlertRule(AlertRule)`

    - #### 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 `AlertManager.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

          @Deprecated
          void deleteAlertRule(Long id)
                                     throws LiveViewException

      Deprecated. : Use `AlertManager.deleteAlertRule(String)` instead.
      Deletes the `AlertRule` from the server that matches the given legacy ID. A LiveViewException is thrown if the rule does not exist on the server.
      Parameters:
        `id` - : The id of the `AlertRule` to delete.
      Throws:
        `LiveViewException` - if there is a problem with the request or network issue or no alert rule can be found with the given id.

    - #### 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

Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.