@Entity public class AlertCurrentEntity extends Object
AlertCurrentEntity
class represents the most recently received an
alert data for a given instance. This class always has an associated matching
AlertHistoryEntity
that defines the actual data of the alert.
There will only ever be a single entity for each given
AlertDefinitionEntity
.Constructor and Description |
---|
AlertCurrentEntity()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Gets the equality to another alert based on the following criteria:
alertId
alertHistory
|
AlertHistoryEntity |
getAlertHistory()
Gets the associated
AlertHistoryEntity entry for this current alert
instance. |
Long |
getAlertId()
Gets the unique ID for this current alert.
|
Long |
getDefinitionId()
Get parent alert definition id
|
AlertFirmness |
getFirmness()
Gets the firmness of the alert, indicating whether or not it could be a
potential false positive.
|
Long |
getHistoryId()
Get the related alert history id.
|
String |
getLatestText()
Gets the latest text for this alert.
|
Long |
getLatestTimestamp()
Gets the time, in millis, that the last instance of this alert state was
received.
|
MaintenanceState |
getMaintenanceState()
Gets the current maintenance state for the alert.
|
Long |
getOccurrences()
Gets the number of occurrences of this alert in its current state.
|
Long |
getOriginalTimestamp()
Gets the time, in milliseconds, when the alert was first received with the
current state.
|
int |
hashCode()
Generates a hash for the current alert based on the following criteria:
alertId
alertHistory
For new alerts, the associated AlertHistoryEntity may not be
persisted yet. |
void |
setAlertHistory(AlertHistoryEntity alertHistory)
Sets the associated
AlertHistoryEntity entry for this current alert
instance. |
void |
setAlertId(Long alertId)
Sets the unique ID for this current alert.
|
void |
setDefinitionId(Long definitionId)
Set the parent alert definition id
|
void |
setFirmness(AlertFirmness firmness)
Sets the firmness of the alert, indicating whether or not it could be a
potential false positive.
|
void |
setHistoryId(Long historyId)
Set the related history id.
|
void |
setLatestText(String text)
Sets the latest text.
|
void |
setLatestTimestamp(Long latestTimestamp)
Sets the time, in millis, that the last instance of this alert state was
received.
|
void |
setMaintenanceState(MaintenanceState maintenanceState)
Sets the current maintenance state for the alert.
|
void |
setOccurrences(long occurrences)
Sets the number of occurrences for this alert instance.
|
void |
setOriginalTimestamp(Long originalTimestamp)
Sets the time, in milliseconds, when the alert was first received with the
current state.
|
String |
toString() |
public Long getAlertId()
null
).public void setAlertId(Long alertId)
alertId
- the ID (not null
).public Long getHistoryId()
public void setHistoryId(Long historyId)
historyId
- historyIdpublic Long getDefinitionId()
public void setDefinitionId(Long definitionId)
definitionId
- definition idpublic Long getLatestTimestamp()
null
).public void setLatestTimestamp(Long latestTimestamp)
latestTimestamp
- the time of the most recently received alert data for this
instance (never null
).public MaintenanceState getMaintenanceState()
null
).public void setMaintenanceState(MaintenanceState maintenanceState)
maintenanceState
- the state to set (not null
).public Long getOriginalTimestamp()
public void setOriginalTimestamp(Long originalTimestamp)
originalTimestamp
- the time of the first instance of this alert (not null
).public String getLatestText()
public void setLatestText(String text)
getLatestText()
public Long getOccurrences()
AlertState.OK
are aggregated such that transitioning
between these states should not reset this value. For example, if an alert
bounces between AlertState.WARNING
and AlertState.CRITICAL
,
then it will not reset this value.public void setOccurrences(long occurrences)
occurrences
- the occurrences.getOccurrences()
public AlertFirmness getFirmness()
public void setFirmness(AlertFirmness firmness)
firmness
- the firmness (not null
).public AlertHistoryEntity getAlertHistory()
AlertHistoryEntity
entry for this current alert
instance.null
).public void setAlertHistory(AlertHistoryEntity alertHistory)
AlertHistoryEntity
entry for this current alert
instance. This will update the internal fields of this current alert with
those from the alertHistory.alertHistory
- the most recently received history entry (not null
).public boolean equals(Object object)
public int hashCode()
AlertHistoryEntity
may not be
persisted yet. This will rely on the
AlertHistoryEntity.equals(Object)
and
AlertHistoryEntity.hashCode()
being correct.
Copyright © 2022 Apache Software Foundation. All rights reserved.