com.cumulocity.model.event
Class Alarm

java.lang.Object
  extended by org.svenson.AbstractDynamicProperties
      extended by com.cumulocity.model.JSONBase
          extended by com.cumulocity.model.Document<GId>
              extended by com.cumulocity.model.event.Event
                  extended by com.cumulocity.model.event.Alarm
All Implemented Interfaces:
org.svenson.DynamicProperties

public class Alarm
extends Event

Represents an Alarm.
Status and severity are added to the standard Event properties. Status and severity are strings because different verticals may require different values for these properties. History of changes to this alarm should be captured by the AuditRecord collection.


Constructor Summary
Alarm()
           
 
Method Summary
 void addAuditRecord(AuditRecord auditRecord)
           
 boolean equals(Object obj)
           
 List<AuditRecord> getHistory()
          Returns the audit history containing the changes made to this alarm.
 Severity getSeverity()
           
 AlarmStatus getStatus()
           
 int hashCode()
           
 void setHistory(List<AuditRecord> history)
           
 void setSeverity(Severity severity)
          Set the severity of this alarm.
 void setStatus(AlarmStatus status)
          Set the status of this alarm.
 
Methods inherited from class com.cumulocity.model.event.Event
getCreationTime, getSource, getText, getTime, getType, setCreationTime, setSource, setText, setTime, setType
 
Methods inherited from class com.cumulocity.model.Document
get, get, getFragment, getId, getInternalId, getRevision, set, set, set, setId, setInternalId, setRevision, toString
 
Methods inherited from class com.cumulocity.model.JSONBase
fromJSON, getJSONGenerator, getJSONParser, toJSON
 
Methods inherited from class org.svenson.AbstractDynamicProperties
getProperty, propertyNames, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Alarm

public Alarm()
Method Detail

getStatus

public AlarmStatus getStatus()

setStatus

@JSONProperty(value="status",
              ignoreIfNull=true)
@JSONConverter(type=AlarmStatusConverter.class)
public void setStatus(AlarmStatus status)
Set the status of this alarm.

Parameters:
status - Typical values are active, acknowledged or cleared

getSeverity

public Severity getSeverity()

setSeverity

@JSONProperty(value="severity",
              ignoreIfNull=true)
@JSONConverter(type=SeverityConverter.class)
public void setSeverity(Severity severity)
Set the severity of this alarm.

Parameters:
severity - Typical values are: critical, major, minor and warning

getHistory

public List<AuditRecord> getHistory()
Returns the audit history containing the changes made to this alarm.

Returns:

setHistory

@JSONProperty(value="history",
              ignoreIfNull=true)
@JSONTypeHint(value=AuditRecord.class)
public void setHistory(List<AuditRecord> history)

addAuditRecord

public void addAuditRecord(AuditRecord auditRecord)

hashCode

public int hashCode()
Overrides:
hashCode in class Event

equals

public boolean equals(Object obj)
Overrides:
equals in class Event


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.