Class POJOEvent
java.lang.Object
org.epics.archiverappliance.common.POJOEvent
- All Implemented Interfaces:
PartionedTime,AlarmInfo,DBRTimeEvent,FieldValues,SamplingInfo,Event,org.json.simple.JSONAware
A simple POJO that implements the event interface.
Use for converting into the PB classes especially in the post processors.
- Author:
- mshankar
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPOJOEvent(ArchDBRTypes dbrType, Instant recordProcessingTime, String sampleValueStr, int status, int severity) POJOEvent(ArchDBRTypes dbrType, Instant recordProcessingTime, SampleValue sampleValue, int status, int severity) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFieldValue(String fieldName, String fieldValue) longGet java epoch seconds of the timestamp of this event.Get the epoch seconds and the nanos..Get the fields as a HashMap.getFieldValue(String fieldName) com.google.protobuf.MessageReturn the protobuf message.Class<? extends com.google.protobuf.Message> Return the protobuf message class.Return a serialized form of this event in the internal currency of the archiver appliance.intGet this event's value.intintbooleanNot all events have field values.booleanDo the field values in this event represent an actual change?Make a clone of this event free from the confines of its containing stream.voidMark this event as containing actual changes to field values.voidsetFieldValues(HashMap<String, String> fieldValues, boolean markAsActualChange) voidsetRepeatCount(int repeatCount) voidsetSeverity(int severity) voidsetStatus(int status) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.epics.archiverappliance.data.DBRTimeEvent
getYearSecondTimestamp, toJSONString
-
Field Details
-
logger
public static org.apache.logging.log4j.Logger logger
-
-
Constructor Details
-
POJOEvent
public POJOEvent(ArchDBRTypes dbrType, Instant recordProcessingTime, SampleValue sampleValue, int status, int severity) -
POJOEvent
public POJOEvent(ArchDBRTypes dbrType, Instant recordProcessingTime, String sampleValueStr, int status, int severity)
-
-
Method Details
-
makeClone
Description copied from interface:EventMake a clone of this event free from the confines of its containing stream. -
getSampleValue
Description copied from interface:EventGet this event's value. The value for an EPICS sample is a complex thing and can be scalars and vectors of numbers and strings. With EPICS v4, this can get even more complicated.- Specified by:
getSampleValuein interfaceEvent- Returns:
- The valus of this event
-
getEventTimeStamp
Description copied from interface:EventGet the epoch seconds and the nanos.. We use Instant as the main timestamp class. See TimeUtils for more time related utilities.- Specified by:
getEventTimeStampin interfaceEvent- Returns:
- The java epoch seconds and the nanos of this event
-
getStatus
public int getStatus() -
getSeverity
public int getSeverity()- Specified by:
getSeverityin interfaceAlarmInfo
-
getRepeatCount
public int getRepeatCount()- Specified by:
getRepeatCountin interfaceSamplingInfo
-
setRepeatCount
public void setRepeatCount(int repeatCount) - Specified by:
setRepeatCountin interfaceSamplingInfo
-
getEpochSeconds
public long getEpochSeconds()Description copied from interface:EventGet java epoch seconds of the timestamp of this event. Note that we are skipping nanos. To get to the nanos use the getEventTimeStamp method.- Specified by:
getEpochSecondsin interfaceEvent- Returns:
- The java epoch seconds of this event.
-
getRawForm
Description copied from interface:EventReturn a serialized form of this event in the internal currency of the archiver appliance. For now, this is Google's Protocol Buffers Note that the raw form is always escaped according to the archiver specification. This is to have a minimum of conversion overhead when streaming data out to servers.- Specified by:
getRawFormin interfaceEvent- Returns:
- A serialization of this event in the internal currency of the archiver appliance.
-
hasFieldValues
public boolean hasFieldValues()Description copied from interface:FieldValuesNot all events have field values. Does this event have any field values?- Specified by:
hasFieldValuesin interfaceFieldValues- Returns:
- true or false
-
isActualChange
public boolean isActualChange()Description copied from interface:FieldValuesDo the field values in this event represent an actual change?- Specified by:
isActualChangein interfaceFieldValues- Returns:
- true or false
-
getFields
Description copied from interface:FieldValuesGet the fields as a HashMap. If we have more than one entry with the same key, one of the entries is returned.- Specified by:
getFieldsin interfaceFieldValues- Returns:
- The fields as a HashMap
-
getFieldValue
- Specified by:
getFieldValuein interfaceFieldValues- Parameters:
fieldName- the field name- Returns:
- The field value as a string
-
addFieldValue
- Specified by:
addFieldValuein interfaceFieldValues- Parameters:
fieldName- the field namefieldValue- the field value
-
markAsActualChange
public void markAsActualChange()Description copied from interface:FieldValuesMark this event as containing actual changes to field values.- Specified by:
markAsActualChangein interfaceFieldValues
-
setFieldValues
- Specified by:
setFieldValuesin interfaceFieldValues- Parameters:
fieldValues- the field values as HashMapmarkAsActualChange- true or false
-
getDBRType
- Specified by:
getDBRTypein interfaceEvent
-
setStatus
public void setStatus(int status) -
setSeverity
public void setSeverity(int severity) - Specified by:
setSeverityin interfaceAlarmInfo
-
getProtobufMessage
public com.google.protobuf.Message getProtobufMessage()Description copied from interface:EventReturn the protobuf message.- Specified by:
getProtobufMessagein interfaceEvent
-
getProtobufMessageClass
Description copied from interface:EventReturn the protobuf message class.- Specified by:
getProtobufMessageClassin interfaceEvent
-