Package org.epics.archiverappliance.data
Class HashMapEvent
java.lang.Object
org.epics.archiverappliance.data.HashMapEvent
- All Implemented Interfaces:
PartionedTime,AlarmInfo,DBRTimeEvent,FieldValues,SamplingInfo,Event,org.json.simple.JSONAware
We get a HashMap of NVPairs from the Channel Archiver - this class exposes these as an archiver Event
We typically get secs=1250696265, value=70.9337, sevr=0, nano=267115322, stat=0
- Author:
- mshankar
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHashMapEvent(ArchDBRTypes type, Map<String, Object> values) HashMapEvent(ArchDBRTypes type, DBRTimeEvent event) -
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) voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.epics.archiverappliance.data.DBRTimeEvent
getYearSecondTimestamp, toJSONString
-
Field Details
-
SECS_FIELD_NAME
- See Also:
-
NANO_FIELD_NAME
- See Also:
-
VALUE_FIELD_NAME
- See Also:
-
RAW_VALUE_FIELD_NAME
- See Also:
-
STAT_FIELD_NAME
- See Also:
-
SEVR_FIELD_NAME
- See Also:
-
FIELD_VALUES_FIELD_NAME
- See Also:
-
FIELD_VALUES_ACTUAL_CHANGE
- See Also:
-
-
Constructor Details
-
HashMapEvent
-
HashMapEvent
-
-
Method Details
-
setValue
-
makeClone
Description copied from interface:EventMake a clone of this event free from the confines of its containing stream. -
getRepeatCount
public int getRepeatCount()- Specified by:
getRepeatCountin interfaceSamplingInfo
-
setRepeatCount
public void setRepeatCount(int repeatCount) - Specified by:
setRepeatCountin interfaceSamplingInfo
-
getStatus
public int getStatus() -
getSeverity
public int getSeverity()- Specified by:
getSeverityin interfaceAlarmInfo
-
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.
-
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
-
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.
-
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
-
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
-
toString
-