com.h3c.sdn.alert

## Class Alert

- java.lang.Object
- - com.h3c.sdn.AbstractModel<T,UUID>
  - - com.h3c.sdn.Model<T>
    - - com.h3c.sdn.SystemModel<Alert>
      - - com.h3c.sdn.alert.Alert

- All Implemented Interfaces:
    Timeable, Transportable<Alert,UUID>, Versionable, Serializable

      public class Alert
      extends SystemModel<Alert>
      implements Versionable, Timeable

  Descriptor holding the basic information required to represent an alert.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Alert(Id<Alert,UUID> id, Id<SystemInformation,UUID> sysId, boolean state, String topicId, String origin, Date timestamp, Severity severity, String description)` Constructs an instance of an Alert with a unique identification.
    `Alert(Id<SystemInformation,UUID> sysId, boolean state, String topicId, String origin, Date timestamp, Severity severity, String description)` Constructs an instance of an Alert.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDescription()` Returns the data description associated with this alert.
    `String` | `getOrigin()` Returns the origin associated with this alert.
    `Severity` | `getSeverity()` Returns the `Severity` associated with this alert.
    `boolean` | `getState()` Returns the state associated with this alert.
    `Date` | `getTimestamp()` Gets the time the event occurred.
    `String` | `getTopicId()` Returns the topic Id associated with this alert.
    `Long` | `getVersion()` The JPA persistence version identification.
    `void` | `setState(boolean state)` Set the state associated with this alert.
    `void` | `setVersion(Long version)` Sets the version.

    - ### Methods inherited from class com.h3c.sdn.SystemModel

      `getSysId, toString`

    - ### Methods inherited from class com.h3c.sdn.AbstractModel

      `equals, getId, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Alert

          public Alert(Id<SystemInformation,UUID> sysId,
               boolean state,
               String topicId,
               String origin,
               Date timestamp,
               Severity severity,
               String description)

      Constructs an instance of an Alert. An unique identification string will be generated. The supplied system identification must not be null.
      Parameters:
        `sysId` - the unique identification of the system that originally generated this alert
        `state` - the current state of the alert
        `topicId` - the topic Id for this alert
        `origin` - the originating entity for this alert
        `timestamp` - the date when the alert was created
        `severity` - the severity associated with the alert
        `description` - the data description information associated with this alert
      Throws:
        `IllegalArgumentException` - if system identification is null
        `NullPointerException` - if topicId, origin, time stamp, severity, or description are null

    - #### Alert

          public Alert(Id<Alert,UUID> id,
               Id<SystemInformation,UUID> sysId,
               boolean state,
               String topicId,
               String origin,
               Date timestamp,
               Severity severity,
               String description)

      Constructs an instance of an Alert with a unique identification. The supplied unique identification and system identification must not be null.
      Parameters:
        `id` - the external unique identification
        `sysId` - the unique identification of the system that originally generated this alert
        `state` - the current state of the alert
        `topicId` - the topic Id for this alert
        `origin` - the originating entity for this alert
        `timestamp` - the date when the alert was created
        `severity` - the severity associated with the alert
        `description` - the data description information associated with this alert
      Throws:
        `IllegalArgumentException` - if unique identification or system identification are null
        `NullPointerException` - if topicId, origin, time stamp, severity, or description are null

  - ### Method Detail

    - #### getVersion

          public Long getVersion()

      Description copied from interface: `Versionable`
      The JPA persistence version identification. Used for the optimistic locking aspect of the persistence layer. Allows for conversion from Transport object to Data Access object to properly interact with the persistence layer
      Specified by:
        `getVersion` in interface `Versionable`
      Returns:
        the internal version number

    - #### setVersion

          public void setVersion(Long version)

      Description copied from interface: `Versionable`
      Sets the version.
      Specified by:
        `setVersion` in interface `Versionable`
      Parameters:
        `version` - the version.

    - #### getTopicId

          public String getTopicId()

      Returns the topic Id associated with this alert.
      Returns:
        the alert topicId

    - #### getOrigin

          public String getOrigin()

      Returns the origin associated with this alert.
      Returns:
        the alert origin

    - #### getTimestamp

          public Date getTimestamp()

      Description copied from interface: `Timeable`
      Gets the time the event occurred.
      Specified by:
        `getTimestamp` in interface `Timeable`
      Returns:
        the timestamp

    - #### getSeverity

          public Severity getSeverity()

      Returns the `Severity` associated with this alert.
      Returns:
        the alert severity

    - #### getState

          public boolean getState()

      Returns the state associated with this alert.
      Returns:
        `true` if the alert is active, `false` otherwise

    - #### getDescription

          public String getDescription()

      Returns the data description associated with this alert.
      Returns:
        the alerts data description

    - #### setState

          public void setState(boolean state)

      Set the state associated with this alert. `true` if the alert is active, `false` indicates the alert is no longer active.
      Parameters:
        `state` - the desired state for the alert

Copyright © 2014. All Rights Reserved.