com.h3c.sdn.adm.dao.model

## Class AlertEntity

- java.lang.Object
- - com.h3c.sdn.dao.model.BaseEntity
  - - com.h3c.sdn.dao.model.BaseVersionedEntity
    - - com.h3c.sdn.dao.model.SystemLocalVersionedEntity
      - - com.h3c.sdn.adm.dao.model.AlertEntity

- All Implemented Interfaces:
    Storable<UUID>, Versioned

      @Entity
      public class AlertEntity
      extends SystemLocalVersionedEntity

  Represents an Alert entity within the persistence layer. Provides a default constructor for use by the persistence layer. Once the Alert entity has been persisted, the only field that is expected to be changed is the State field, hence the only setter method exposed is for this field. All other fields will either be set by the persistence layer or via the full constructor.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AlertEntity.AlertSeverity` Representation of the Severity enumeration - required due to OSGi behaviors with regards to the JPA representation of all entity artifacts maintained in the same physical bundle.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AlertEntity()` Default constructor used by persistence framework.
    `AlertEntity(UUID uid, UUID sysId, Boolean state, String topic, String origin, Date timestamp, Severity severity, String description)` Creates an alert entity.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDescription()` Returns the description information 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 active state of this alert.
    `Date` | `getTimestamp()` Returns the time stamp associated with this alert.
    `String` | `getTopic()` Returns the topic associated with this alert.
    `void` | `setState(boolean newState)` Set the state for this alert.

    - ### Methods inherited from class com.h3c.sdn.dao.model.SystemLocalVersionedEntity

      `getSysId`

    - ### Methods inherited from class com.h3c.sdn.dao.model.BaseVersionedEntity

      `getVersion`

    - ### Methods inherited from class com.h3c.sdn.dao.model.BaseEntity

      `equals, getId, hashCode, toString`

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

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

- - ### Constructor Detail

    - #### AlertEntity

          public AlertEntity()

      Default constructor used by persistence framework.

    - #### AlertEntity

          public AlertEntity(UUID uid,
                     UUID sysId,
                     Boolean state,
                     String topic,
                     String origin,
                     Date timestamp,
                     Severity severity,
                     String description)

      Creates an alert entity.
      Parameters:
        `uid` - the external unique identify
        `sysId` - the system id associated with the alert
        `state` - the state of the alert (active or not)
        `topic` - the topic associated with this alert
        `origin` - The origin of this alert
        `timestamp` - the time when the alert was created
        `severity` - the severity associated with this alert
        `description` - the data description containing the data associated with this alert

  - ### Method Detail

    - #### getTopic

          public String getTopic()

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

    - #### getOrigin

          public String getOrigin()

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

    - #### getTimestamp

          public Date getTimestamp()

      Returns the time stamp associated with this alert.
      Returns:
        the time of alert creation

    - #### getSeverity

          public Severity getSeverity()

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

    - #### getState

          public boolean getState()

      Returns the active state of this alert.
      Returns:
        `true` if the event is active, `false` otherwise

    - #### getDescription

          public String getDescription()

      Returns the description information associated with this alert.
      Returns:
        the alert description

    - #### setState

          public void setState(boolean newState)

      Set the state for this alert.
      Parameters:
        `newState` - the desired state

Copyright © 2014. All Rights Reserved.