Class Record
Record class.
- Author:
- igor@scictrl.com
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructor for Record.Constructor for Record.Record
(String name, gov.aps.jca.dbr.DBRType type, int count, String units, Number upperDispLimit, Number lowerDispLimit, Number upperWarningLimit, Number lowerWarningLimit, Number upperAlarmLimit, Number lowerAlarmLimit, Number upperCtrlLimit, Number lowerCtrlLimit, short precision, String[] enumLabels, String description) Constructor for Record. -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
activate.void
Adds listener to all three change events: PROPERTY_RECORD, PROPERTY_VALUE and PROPERTY_ALARM.void
Adds listener to one of three change events: PROPERTY_RECORD, PROPERTY_VALUE and PROPERTY_ALARM.void
copyFields
(Record record) copyFields.void
copyFields
(MetaData md) copyFields.void
copyUnitsControlLimits
(Record record) copyUnitsControlLimits.static MetaData
extractMetaData.void
fireAlarmChange.void
fireRecordChange.void
fireValueChange.void
fireWriteEvent.static Record
forProcessor
(String name, gov.aps.jca.dbr.DBRType type, int count, String description, ValueProcessor proc, org.apache.commons.configuration.HierarchicalConfiguration config) Return new Record containing the provided processor.gov.aps.jca.dbr.Severity
Getter for the fieldalarmSeverity
.gov.aps.jca.dbr.Status
Getter for the fieldalarmStatus
.If this record belongs to an application, then this method returns that application, otherwisenull
is returned.int
getCount()
Getter for the fieldcount
.Getter for the fielddatabase
.Getter for the fielddescription
.String[]
Getter for the fieldenumLabels
.Getter for the fieldlowerAlarmLimit
.Getter for the fieldlowerCtrlLimit
.Getter for the fieldlowerDispLimit
.Getter for the fieldlowerWarningLimit
.getName()
Getter for the fieldname
.short
Getter for the fieldprecision
.Getter for the fieldprocessor
.gov.aps.jca.dbr.TimeStamp
getTimestamp.gov.aps.jca.dbr.DBRType
getType()
Getter for the fieldtype
.getUnits()
Getter for the fieldunits
.Getter for the fieldupperAlarmLimit
.Getter for the fieldupperCtrlLimit
.Getter for the fieldupperDispLimit
.Getter for the fieldupperWarningLimit
.getValue()
getValue.boolean
getValueAsBoolean.double
getValueAsDouble.double[]
getValueAsDoubleArray.int
getValueAsInt.getValueAsString.void
initialize
(Database database) This method is called by Database when record is added to the Database.boolean
isActivated.boolean
isAlarm()
isAlarm.boolean
isAlarmUndefined.boolean
isPersistent.boolean
Returnstrue
if this record supports value writing.void
removePropertyChangeListener.void
removePropertyChangeListener.void
setApplication
(Application application) This method is called by application instances for all records created by that application.void
setCount
(int count) Setter for the fieldcount
.void
setMinMax.void
setPersistent
(boolean persistent) Sets persistency flag.void
This is part of initialization of Record, it is called afterValueProcessor.configure(Record, org.apache.commons.configuration.HierarchicalConfiguration)
has been called, so processor is already configured.void
This method sets new value to the value processor for this record.void
setValueAsString
(String value) setValueAsString.void
setWritable
(boolean writable) Sets the writable flag.static final String
toPropertyName
(String name) Converts property name to PROPERTY_VALUE or PROPERTY_ALARM, useful when parsing configuration input.toString()
void
updateAlarm
(gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status) updateAlarm.void
updateAlarm
(gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify) updateAlarm.void
updateNoAlarm.void
This method sets new value to the value processor for this record.
-
Field Details
-
PROPERTY_RECORD
ConstantPROPERTY_RECORD="record"
- See Also:
-
PROPERTY_VALUE
ConstantPROPERTY_VALUE="value"
- See Also:
-
PROPERTY_ALARM
ConstantPROPERTY_ALARM="alarm"
- See Also:
-
PROPERTY_WRITE
ConstantPROPERTY_WRITE="write"
- See Also:
-
-
Constructor Details
-
Record
Constructor for Record.
- Parameters:
name
- aString
objecttype
- aDBRType
objectcount
- a int
-
Record
Constructor for Record.
-
Record
public Record(String name, gov.aps.jca.dbr.DBRType type, int count, String units, Number upperDispLimit, Number lowerDispLimit, Number upperWarningLimit, Number lowerWarningLimit, Number upperAlarmLimit, Number lowerAlarmLimit, Number upperCtrlLimit, Number lowerCtrlLimit, short precision, String[] enumLabels, String description) Constructor for Record.
- Parameters:
name
- aString
objecttype
- aDBRType
objectcount
- a intunits
- aString
objectupperDispLimit
- aNumber
objectlowerDispLimit
- aNumber
objectupperWarningLimit
- aNumber
objectlowerWarningLimit
- aNumber
objectupperAlarmLimit
- aNumber
objectlowerAlarmLimit
- aNumber
objectupperCtrlLimit
- aNumber
objectlowerCtrlLimit
- aNumber
objectprecision
- a shortenumLabels
- an array ofString
objectsdescription
- aString
object
-
-
Method Details
-
extractMetaData
extractMetaData.
-
toPropertyName
Converts property name to PROPERTY_VALUE or PROPERTY_ALARM, useful when parsing configuration input.- Parameters:
name
- unformatted property name, should be "value" or "alarm".- Returns:
- return PROPERTY_VALUE or PROPERTY_ALARM if matched or
null
if not matched.
-
forProcessor
public static Record forProcessor(String name, gov.aps.jca.dbr.DBRType type, int count, String description, ValueProcessor proc, org.apache.commons.configuration.HierarchicalConfiguration config) Return new Record containing the provided processor.- Parameters:
name
- aString
objecttype
- aDBRType
objectcount
- a intdescription
- aString
objectproc
- aValueProcessor
objectconfig
- aHierarchicalConfiguration
object- Returns:
- a
Record
object
-
isActivated
public boolean isActivated()isActivated.
- Returns:
- a boolean
-
setPersistent
public void setPersistent(boolean persistent) Sets persistency flag. Persistent record will save it's value when changed on disk and receive last saved value at restart.- Parameters:
persistent
- a boolean
-
isPersistent
public boolean isPersistent()isPersistent.
- Returns:
- a boolean
-
getApplication
If this record belongs to an application, then this method returns that application, otherwisenull
is returned.- Returns:
- an application if exist or
null
-
setApplication
This method is called by application instances for all records created by that application.- Parameters:
application
- aApplication
object
-
getDescription
Getter for the field
description
.- Returns:
- a
String
object
-
getName
Getter for the field
name
.- Returns:
- a
String
object
-
getType
public gov.aps.jca.dbr.DBRType getType()Getter for the field
type
.- Returns:
- a
DBRType
object
-
getCount
public int getCount()Getter for the field
count
.- Returns:
- a int
-
getEnumLabels
Getter for the field
enumLabels
.- Returns:
- an array of
String
objects
-
getLowerAlarmLimit
Getter for the field
lowerAlarmLimit
.- Returns:
- a
Number
object
-
getLowerCtrlLimit
Getter for the field
lowerCtrlLimit
.- Returns:
- a
Number
object
-
getLowerDispLimit
Getter for the field
lowerDispLimit
.- Returns:
- a
Number
object
-
getLowerWarningLimit
Getter for the field
lowerWarningLimit
.- Returns:
- a
Number
object
-
getPrecision
public short getPrecision()Getter for the field
precision
.- Returns:
- a short
-
getTimestamp
public gov.aps.jca.dbr.TimeStamp getTimestamp()getTimestamp.
- Returns:
- a
TimeStamp
object
-
getUnits
Getter for the field
units
.- Returns:
- a
String
object
-
getUpperAlarmLimit
Getter for the field
upperAlarmLimit
.- Returns:
- a
Number
object
-
getUpperCtrlLimit
Getter for the field
upperCtrlLimit
.- Returns:
- a
Number
object
-
getUpperDispLimit
Getter for the field
upperDispLimit
.- Returns:
- a
Number
object
-
getUpperWarningLimit
Getter for the field
upperWarningLimit
.- Returns:
- a
Number
object
-
getValue
getValue.
- Returns:
- a
Object
object
-
getValueAsDouble
public double getValueAsDouble()getValueAsDouble.
- Returns:
- a double
-
getValueAsInt
public int getValueAsInt()getValueAsInt.
- Returns:
- a int
-
getValueAsBoolean
public boolean getValueAsBoolean()getValueAsBoolean.
- Returns:
- a boolean
-
getValueAsDoubleArray
public double[] getValueAsDoubleArray()getValueAsDoubleArray.
- Returns:
- an array of
invalid reference
double
-
getValueAsString
getValueAsString.
- Returns:
- a
String
object
-
setValue
This method sets new value to the value processor for this record. If current value at the processor is the same, than no value-change event is fired and none will be notified, that attempt at value change has been done.To force value processing regardless of the matching values, then call write.
- Parameters:
value
- the value to be set to the processor
-
write
This method sets new value to the value processor for this record. This call might first fire thePROPERTY_VALUE
only if value was actually changed, then it will always fire thePROPERTY_WRITE
change event to signal that value change change attempt was done. This method is called from CAJ remote call handler each time a remote request is made. It is also called fromValueLinks
object when an local application or a processor wants to mimic a remote write and it is this ways processed as a remote call.- Parameters:
value
- the value to be set to the processor
-
isWrittable
public boolean isWrittable()Returnstrue
if this record supports value writing. If not, calling write (remote call) will not be passed to the processor.- Returns:
true
if this record supports value writing
-
setWritable
public void setWritable(boolean writable) Sets the writable flag. Iftrue
then this record supports value writing. If not, calling write (remote call) will not be passed to the processor.- Parameters:
writable
- the writable flag, iftrue
then this record supports value writing
-
setCount
public void setCount(int count) Setter for the field
count
.- Parameters:
count
- a int
-
activate
public void activate()activate.
-
initialize
This method is called by Database when record is added to the Database.- Parameters:
database
- a Database object to which this record was added.
-
setProcessor
This is part of initialization of Record, it is called afterValueProcessor.configure(Record, org.apache.commons.configuration.HierarchicalConfiguration)
has been called, so processor is already configured.- Parameters:
vp
- aValueProcessor
object
-
getDatabase
Getter for the field
database
.- Returns:
- a
Database
object
-
addPropertyChangeListener
Adds listener to one of three change events: PROPERTY_RECORD, PROPERTY_VALUE and PROPERTY_ALARM.- Parameters:
name
- the name of property, supported are: PROPERTY_RECORD, PROPERTY_VALUE, PROPERTY_ALARMl
- the listener
-
addPropertyChangeListener
Adds listener to all three change events: PROPERTY_RECORD, PROPERTY_VALUE and PROPERTY_ALARM.- Parameters:
l
- the listener
-
removePropertyChangeListener
removePropertyChangeListener.
- Parameters:
name
- aString
objectl
- aPropertyChangeListener
object
-
removePropertyChangeListener
removePropertyChangeListener.
- Parameters:
l
- aPropertyChangeListener
object
-
fireRecordChange
public void fireRecordChange()fireRecordChange.
-
fireValueChange
public void fireValueChange()fireValueChange.
-
fireWriteEvent
public void fireWriteEvent()fireWriteEvent.
-
fireAlarmChange
public void fireAlarmChange()fireAlarmChange.
-
getAlarmSeverity
public gov.aps.jca.dbr.Severity getAlarmSeverity()Getter for the field
alarmSeverity
.- Returns:
- a
Severity
object
-
getAlarmStatus
public gov.aps.jca.dbr.Status getAlarmStatus()Getter for the field
alarmStatus
.- Returns:
- a
Status
object
-
isAlarmUndefined
public boolean isAlarmUndefined()isAlarmUndefined.
- Returns:
- a boolean
-
isAlarm
public boolean isAlarm()isAlarm.
- Returns:
- a boolean
-
updateNoAlarm
public void updateNoAlarm()updateNoAlarm.
-
updateAlarm
public void updateAlarm(gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status) updateAlarm.
- Parameters:
severity
- aSeverity
objectstatus
- aStatus
object
-
updateAlarm
public void updateAlarm(gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify) updateAlarm.
- Parameters:
severity
- aSeverity
objectstatus
- aStatus
objectnotify
- a boolean
-
getProcessor
Getter for the field
processor
.- Returns:
- a
ValueProcessor
object
-
toString
-
copyFields
copyFields.
- Parameters:
record
- aRecord
object
-
copyUnitsControlLimits
copyUnitsControlLimits.
- Parameters:
record
- aRecord
object
-
copyFields
copyFields.
- Parameters:
md
- aMetaData
object
-
setValueAsString
setValueAsString.
- Parameters:
value
- aString
object
-
setMinMax
setMinMax.
-