com.h3c.sdn.adm.alert

## Interface AlertService

- All Known Subinterfaces:
    AlertServiceInternal

      public interface AlertService

  Basic service supporting `Alert` management.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `alertCount()` Returns the number of alerts maintained in persistence.
    `List<Alert>` | `find(AlertFilter filter, SortSpecification<AlertSortAttribute> sortSpec)` Get a list of all `Alert` objects present in the system, based on the criteria exposed by the supplied filter, and sorted based on the supplied sort specification.
    `Page<Alert>` | `find(AlertFilter filter, SortSpecification<AlertSortAttribute> sortSpec, PageRequest pageRequest)` Returns a page of `Alert` objects present in the system, based on the page specification, the criteria exposed by the supplied filter, and sorted based on the supplied sort specification
    `AlertSummary` | `getAlertSummary()` Produces the `AlertSummary` representation for the Alerts currently in the system.
    `AlertTopic` | `getTopic(String id)` Return the registered alert topic with the given id.
    `void` | `importAlerts(List<Alert> alerts)` Accepts a list of `Alert` objects and adds them to the local Alert data persistence.
    `List<AlertTopic>` | `listTopics(String origin)` Return the list of registered alert topics.
    `Alert` | `post(Severity severity, AlertTopic topic, String origin, String data)` Creates a new `Alert` based on the supplied parameters.
    `AlertTopic` | `registerTopic(String id, String orig, String desc)` Register a topic string representing a classification for alerts.
    `long` | `updateAlerts(boolean state, Map<String,List<String>> sysidToUidMap)` Changes the state of the alerts to the supplied new state.
    `void` | `updateState(Alert alert)` Changes the state of a given `Alert`

- - ### Method Detail

    - #### registerTopic

          AlertTopic registerTopic(String id,
                                 String orig,
                                 String desc)

      Register a topic string representing a classification for alerts.
      Parameters:
        `id` - the identification for this topic
        `orig` - the origin of this topic
        `desc` - the description of this topic
      Returns:
        the registered topic
      Throws:
        `IllegalArgumentException` - if name is null or empty

    - #### listTopics

          List<AlertTopic> listTopics(String origin)

      Return the list of registered alert topics. The list of alert topics can be restricted to just the topics that originated from the supplied origin.
      Parameters:
        `origin` - the origin of the Alert Topic
      Returns:
        the list of registered topics

    - #### getTopic

          AlertTopic getTopic(String id)

      Return the registered alert topic with the given id.
      Parameters:
        `id` - the Id of the Alert Topic
      Returns:
        the registered topic with the given Id if one has been registered, `null` otherwise

    - #### post

          Alert post(Severity severity,
                   AlertTopic topic,
                   String origin,
                   String data)

      Creates a new `Alert` based on the supplied parameters.
      Parameters:
        `severity` - `Severity` associated with this alert
        `topic` - the topic associated with this alert
        `origin` - Originating entity for this Alert
        `data` - The data associated with this alert
      Returns:
        The created Alert object
      Throws:
        `NullPointerException` - if any of the parameters are null

    - #### importAlerts

          void importAlerts(List<Alert> alerts)

      Accepts a list of `Alert` objects and adds them to the local Alert data persistence.
      Parameters:
        `alerts` - the list of Alert objects to import

    - #### alertCount

          long alertCount()

      Returns the number of alerts maintained in persistence.
      Returns:
        the number of alerts

    - #### find

          List<Alert> find(AlertFilter filter,
                         SortSpecification<AlertSortAttribute> sortSpec)

      Get a list of all `Alert` objects present in the system, based on the criteria exposed by the supplied filter, and sorted based on the supplied sort specification.
      Parameters:
        `filter` - `AlertFilter` object expressing the desired filtering criteria to consider for restricting the resulting list of Alert objects
        `sortSpec` - `SortSpecification` defining how the data should be sorted for return. The SortSpecification must be typed with a `AlertSortAttribute` representation.
      Returns:
        the list of Alert objects

    - #### find

          Page<Alert> find(AlertFilter filter,
                         SortSpecification<AlertSortAttribute> sortSpec,
                         PageRequest pageRequest)

      Returns a page of `Alert` objects present in the system, based on the page specification, the criteria exposed by the supplied filter, and sorted based on the supplied sort specification
      Parameters:
        `filter` - `AlertFilter` object expressing the desired filtering criteria to consider for restricting the resulting list of Alert objects
        `sortSpec` - `SortSpecification` defining how the alert data should be sorted for return.The SortSpecification must be typed with a `AlertSortAttribute` representation.
        `pageRequest` - `PageRequest` the definition of the desired page
      Returns:
        `Page` of Alert data

    - #### getAlertSummary

          AlertSummary getAlertSummary()

      Produces the `AlertSummary` representation for the Alerts currently in the system.
      Returns:
        return an AlertSummary

    - #### updateState

          void updateState(Alert alert)

      Changes the state of a given `Alert`
      Parameters:
        `alert` - The alert containing the updated data

    - #### updateAlerts

          long updateAlerts(boolean state,
                          Map<String,List<String>> sysidToUidMap)

      Changes the state of the alerts to the supplied new state. The alerts are represented by the uid, and grouped by sysid
      Parameters:
        `state` - the state that the alerts should be set to
        `sysidToUidMap` - the map of alert sysid to list of alert uids, effectively grouping the alerts by they sysid of the system that generated the alert
      Returns:
        the count of alerts that have been updated.

Copyright © 2014. All Rights Reserved.