Class AlertDto

java.lang.Object
com.qfs.snl.dtos.AlertDto
All Implemented Interfaces:
ISentinelAlert, ILocatedResource, ISiteLocated, IIdentifiable, Serializable

public class AlertDto extends Object implements ISentinelAlert, Serializable
The data transfer object for an alert.
Author:
ActiveViam
See Also:
  • Constructor Details Link icon

    • AlertDto Link icon

      public AlertDto()
      Default constructor.
    • AlertDto Link icon

      public AlertDto(long id, String site, long monitorId, Long eventId, Long start, Long stop, String content)
      Constructor.
      Parameters:
      id - alert id
      site - agent site
      monitorId - id of the monitor triggering this alert
      eventId - id of the event related to the alert
      start - timestamp in milliseconds at which this alert started
      stop - timestamp in milliseconds at which this alert stopped
      content - full string content of the alert
    • AlertDto Link icon

      public AlertDto(ISentinelAlert alert)
      Constructor.
      Parameters:
      alert - the ISentinelAlert used to generate this Dto
  • Method Details Link icon

    • getId Link icon

      public long getId()
      Description copied from interface: IIdentifiable
      Gets the resource id.
      Specified by:
      getId in interface IIdentifiable
      Returns:
      the id
    • setId Link icon

      public AlertDto setId(long id)
      Sets the unique alert identifier.
      Returns:
      this
    • getSite Link icon

      public String getSite()
      Description copied from interface: ISiteLocated
      Gets the site where the element is located.
      Specified by:
      getSite in interface ISiteLocated
      Returns:
      the site
    • setSite Link icon

      public AlertDto setSite(String site)
      Sets the site.
      Parameters:
      site - The site to set
      Returns:
      this
    • getStart Link icon

      public Long getStart()
      Description copied from interface: ISentinelAlert
      Gets the start time of the alert.
      Specified by:
      getStart in interface ISentinelAlert
      Returns:
      the audit of the alert start
    • setStart Link icon

      public AlertDto setStart(Long start)
      Sets the started.
      Parameters:
      start - The started to set
      Returns:
      this
    • getStop Link icon

      public Long getStop()
      Description copied from interface: ISentinelAlert
      Gets the stop time of the alert.
      Specified by:
      getStop in interface ISentinelAlert
      Returns:
      the audit of the alert stop
    • setStop Link icon

      public AlertDto setStop(Long stop)
      Sets the stopped.
      Parameters:
      stop - The stopped to set
      Returns:
      this
    • getContent Link icon

      public String getContent()
      Description copied from interface: ISentinelAlert
      Return the information related to that alert.
      Specified by:
      getContent in interface ISentinelAlert
      Returns:
      the content of the alert
    • setContent Link icon

      public AlertDto setContent(String content)
      Sets the content of the alert.
      Returns:
      this
    • getMonitorId Link icon

      public long getMonitorId()
      Description copied from interface: ISentinelAlert
      Return the id of the monitor that produced the alert.
      Specified by:
      getMonitorId in interface ISentinelAlert
      Returns:
      the id of the monitor
    • setMonitorId Link icon

      public AlertDto setMonitorId(long monitorId)
      Sets the id of the monitor.
      Returns:
      this
    • getEventId Link icon

      public Long getEventId()
      Description copied from interface: ISentinelAlert
      Gets the id of the event that created the alert.
      Specified by:
      getEventId in interface ISentinelAlert
      Returns:
      the event id, null if the alert is not related to an event
    • setEventId Link icon

      public AlertDto setEventId(Long eventId)
      Sets the eventId.
      Parameters:
      eventId - The eventId to set
      Returns:
      this
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hashCode Link icon

      public static int hashCode(ISentinelAlert alert)
      Computes the hashcode of a ISentinelAlert.
      Parameters:
      alert - underlying ISentinelAlert
      Returns:
      the hash code
      See Also:
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals Link icon

      public static boolean equals(ISentinelAlert alert, Object obj)
      Tests the equality between a ISentinelAlert and an object.

      Two alerts are equals if they concern the same monitor (id + site), started at the same time and describes the same content and stemmed from the same event.
      This is consistent for an append-only resource.

      Parameters:
      alert - the reference alert
      obj - the object to test
      Returns:
      true for equality
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • toString Link icon

      public static String toString(ISentinelAlert alert)
      Returns the string representation of the given alert.