Class HashMapEvent

  • All Implemented Interfaces:
    AlarmInfo, DBRTimeEvent, FieldValues, SamplingInfo, Event

    public class HashMapEvent
    extends Object
    implements DBRTimeEvent
    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
    • Method Detail

      • setValue

        public void setValue​(String name,
                             String newValue)
      • makeClone

        public Event makeClone()
        Description copied from interface: Event
        Make a clone of this event free from the confines of its containing stream.
        Specified by:
        makeClone in interface Event
        Returns:
        A clone of this event
      • getEpochSeconds

        public long getEpochSeconds()
        Description copied from interface: Event
        Get 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:
        getEpochSeconds in interface Event
        Returns:
        The java epoch seconds of this event.
      • getEventTimeStamp

        public Timestamp getEventTimeStamp()
        Description copied from interface: Event
        Get the epoch seconds and the nanos.. We use java.sql.Timestamp as the main timestamp class. See TimeUtils for more time related utilities.
        Specified by:
        getEventTimeStamp in interface Event
        Returns:
        The java epoch seconds and the nanos of this event
      • getRawForm

        public ByteArray getRawForm()
        Description copied from interface: Event
        Return 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:
        getRawForm in interface Event
        Returns:
        A serialization of this event in the internal currency of the archiver appliance.
      • getSampleValue

        public SampleValue getSampleValue()
        Description copied from interface: Event
        Get 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:
        getSampleValue in interface Event
        Returns:
        The valus of this event
      • hasFieldValues

        public boolean hasFieldValues()
        Description copied from interface: FieldValues
        Not all events have field values. Does this event have any field values?
        Specified by:
        hasFieldValues in interface FieldValues
        Returns:
        true or false
      • isActualChange

        public boolean isActualChange()
        Description copied from interface: FieldValues
        Do the field values in this event represent an actual change?
        Specified by:
        isActualChange in interface FieldValues
        Returns:
        true or false
      • getFields

        public HashMap<String,​String> getFields()
        Description copied from interface: FieldValues
        Get the fields as a HashMap. If we have more than one entry with the same key, one of the entries is returned.
        Specified by:
        getFields in interface FieldValues
        Returns:
        The fields as a HashMap
      • getFieldValue

        public String getFieldValue​(String fieldName)
        Specified by:
        getFieldValue in interface FieldValues
        Parameters:
        fieldName - the field name
        Returns:
        The field value as a string
      • addFieldValue

        public void addFieldValue​(String fieldName,
                                  String fieldValue)
        Specified by:
        addFieldValue in interface FieldValues
        Parameters:
        fieldName - the field name
        fieldValue - the field value
      • markAsActualChange

        public void markAsActualChange()
        Description copied from interface: FieldValues
        Mark this event as containing actual changes to field values.
        Specified by:
        markAsActualChange in interface FieldValues
      • setFieldValues

        public void setFieldValues​(HashMap<String,​String> fieldValues,
                                   boolean markAsActualChange)
        Specified by:
        setFieldValues in interface FieldValues
        Parameters:
        fieldValues - the field values as HashMap
        markAsActualChange - true or false
      • setStatus

        public void setStatus​(int status)
        Specified by:
        setStatus in interface AlarmInfo
      • setSeverity

        public void setSeverity​(int severity)
        Specified by:
        setSeverity in interface AlarmInfo