Class PBScalarByte
- java.lang.Object
-
- edu.stanford.slac.archiverappliance.PB.data.PBScalarByte
-
- All Implemented Interfaces:
PartionedTime
,AlarmInfo
,DBRTimeEvent
,FieldValues
,SamplingInfo
,Event
public class PBScalarByte extends Object implements DBRTimeEvent, PartionedTime
A DBRTimeEvent for a scalar byte.- Author:
- mshankar
-
-
Constructor Summary
Constructors Constructor Description PBScalarByte(short year, ByteArray bar)
PBScalarByte(gov.aps.jca.dbr.DBR dbr)
PBScalarByte(DBRTimeEvent ev)
PBScalarByte(org.epics.pvdata.pv.PVStructure v4Data)
-
Method Summary
Modifier and Type Method Description void
addFieldValue(String fieldName, String fieldValue)
ArchDBRTypes
getDBRType()
long
getEpochSeconds()
Get java epoch seconds of the timestamp of this event.Timestamp
getEventTimeStamp()
Get the epoch seconds and the nanos..HashMap<String,String>
getFields()
Get the fields as a HashMap.String
getFieldValue(String fieldName)
ByteArray
getRawForm()
Return a serialized form of this event in the internal currency of the archiver appliance.int
getRepeatCount()
SampleValue
getSampleValue()
Get this event's value.int
getSecondsIntoYear()
int
getSeverity()
int
getStatus()
short
getYear()
boolean
hasFieldValues()
Not all events have field values.boolean
isActualChange()
Do the field values in this event represent an actual change?Event
makeClone()
Make a clone of this event free from the confines of its containing stream.void
markAsActualChange()
Mark this event as containing actual changes to field values.void
setFieldValues(HashMap<String,String> fieldValues, boolean markAsActualChange)
void
setRepeatCount(int repeatCount)
void
setSeverity(int severity)
void
setStatus(int status)
-
-
-
Constructor Detail
-
PBScalarByte
public PBScalarByte(short year, ByteArray bar)
-
PBScalarByte
public PBScalarByte(DBRTimeEvent ev)
-
PBScalarByte
public PBScalarByte(gov.aps.jca.dbr.DBR dbr)
-
PBScalarByte
public PBScalarByte(org.epics.pvdata.pv.PVStructure v4Data)
-
-
Method Detail
-
makeClone
public Event makeClone()
Description copied from interface:Event
Make a clone of this event free from the confines of its containing stream.
-
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 interfaceEvent
- Returns:
- The java epoch seconds and the nanos of this event
-
getYear
public short getYear()
- Specified by:
getYear
in interfacePartionedTime
-
getSecondsIntoYear
public int getSecondsIntoYear()
- Specified by:
getSecondsIntoYear
in interfacePartionedTime
-
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 interfaceEvent
- Returns:
- The java epoch seconds 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 interfaceEvent
- 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 interfaceEvent
- Returns:
- The valus of this event
-
getSeverity
public int getSeverity()
- Specified by:
getSeverity
in interfaceAlarmInfo
-
getRepeatCount
public int getRepeatCount()
- Specified by:
getRepeatCount
in interfaceSamplingInfo
-
setRepeatCount
public void setRepeatCount(int repeatCount)
- Specified by:
setRepeatCount
in interfaceSamplingInfo
-
setSeverity
public void setSeverity(int severity)
- Specified by:
setSeverity
in interfaceAlarmInfo
-
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 interfaceFieldValues
- 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 interfaceFieldValues
- 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 interfaceFieldValues
- Returns:
- The fields as a HashMap
-
getFieldValue
public String getFieldValue(String fieldName)
- Specified by:
getFieldValue
in interfaceFieldValues
- Parameters:
fieldName
- the field name- Returns:
- The field value as a string
-
addFieldValue
public void addFieldValue(String fieldName, String fieldValue)
- Specified by:
addFieldValue
in interfaceFieldValues
- Parameters:
fieldName
- the field namefieldValue
- 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 interfaceFieldValues
-
setFieldValues
public void setFieldValues(HashMap<String,String> fieldValues, boolean markAsActualChange)
- Specified by:
setFieldValues
in interfaceFieldValues
- Parameters:
fieldValues
- the field values as HashMapmarkAsActualChange
- true or false
-
getDBRType
public ArchDBRTypes getDBRType()
- Specified by:
getDBRType
in interfaceEvent
-
-