Class Record

java.lang.Object
org.scictrl.csshell.epics.server.Record

public class Record extends Object

Record class.

Author:
igor@scictrl.com
  • Field Details

  • Constructor Details

    • Record

      public Record(String name, gov.aps.jca.dbr.DBRType type, int count)

      Constructor for Record.

      Parameters:
      name - a String object
      type - a DBRType object
      count - a int
    • Record

      public Record(String name, gov.aps.jca.dbr.DBRType type, int count, String description)

      Constructor for Record.

      Parameters:
      name - a String object
      type - a DBRType object
      count - a int
      description - a String object
    • 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 - a String object
      type - a DBRType object
      count - a int
      units - a String object
      upperDispLimit - a Number object
      lowerDispLimit - a Number object
      upperWarningLimit - a Number object
      lowerWarningLimit - a Number object
      upperAlarmLimit - a Number object
      lowerAlarmLimit - a Number object
      upperCtrlLimit - a Number object
      lowerCtrlLimit - a Number object
      precision - a short
      enumLabels - an array of String objects
      description - a String object
  • Method Details

    • extractMetaData

      public static MetaData extractMetaData(Record r)

      extractMetaData.

      Parameters:
      r - a Record object
      Returns:
      a MetaData object
    • toPropertyName

      public static final String toPropertyName(String name)
      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 - a String object
      type - a DBRType object
      count - a int
      description - a String object
      proc - a ValueProcessor object
      config - a HierarchicalConfiguration 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

      public Application getApplication()
      If this record belongs to an application, then this method returns that application, otherwise null is returned.
      Returns:
      an application if exist or null
    • setApplication

      public void setApplication(Application application)
      This method is called by application instances for all records created by that application.
      Parameters:
      application - a Application object
    • getDescription

      public String getDescription()

      Getter for the field description.

      Returns:
      a String object
    • getName

      public String 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

      public String[] getEnumLabels()

      Getter for the field enumLabels.

      Returns:
      an array of String objects
    • getLowerAlarmLimit

      public Number getLowerAlarmLimit()

      Getter for the field lowerAlarmLimit.

      Returns:
      a Number object
    • getLowerCtrlLimit

      public Number getLowerCtrlLimit()

      Getter for the field lowerCtrlLimit.

      Returns:
      a Number object
    • getLowerDispLimit

      public Number getLowerDispLimit()

      Getter for the field lowerDispLimit.

      Returns:
      a Number object
    • getLowerWarningLimit

      public Number 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

      public String getUnits()

      Getter for the field units.

      Returns:
      a String object
    • getUpperAlarmLimit

      public Number getUpperAlarmLimit()

      Getter for the field upperAlarmLimit.

      Returns:
      a Number object
    • getUpperCtrlLimit

      public Number getUpperCtrlLimit()

      Getter for the field upperCtrlLimit.

      Returns:
      a Number object
    • getUpperDispLimit

      public Number getUpperDispLimit()

      Getter for the field upperDispLimit.

      Returns:
      a Number object
    • getUpperWarningLimit

      public Number getUpperWarningLimit()

      Getter for the field upperWarningLimit.

      Returns:
      a Number object
    • getValue

      public 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
      objects
    • getValueAsString

      public String getValueAsString()

      getValueAsString.

      Returns:
      a String object
    • setValue

      public void setValue(Object value)
      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

      public void write(Object value)
      This method sets new value to the value processor for this record. This call might first fire the PROPERTY_VALUE only if value was actually changed, then it will always fire the PROPERTY_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 from ValueLinks 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()
      Returns true 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. If true then this record supports value writing. If not, calling write (remote call) will not be passed to the processor.
      Parameters:
      writable - the writable flag, if true 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

      public void initialize(Database database)
      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

      public void setProcessor(ValueProcessor vp)
      This is part of initialization of Record, it is called after ValueProcessor.configure(Record, org.apache.commons.configuration.HierarchicalConfiguration) has been called, so processor is already configured.
      Parameters:
      vp - a ValueProcessor object
    • getDatabase

      public Database getDatabase()

      Getter for the field database.

      Returns:
      a Database object
    • addPropertyChangeListener

      public void addPropertyChangeListener(String name, PropertyChangeListener l)
      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_ALARM
      l - the listener
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
      Adds listener to all three change events: PROPERTY_RECORD, PROPERTY_VALUE and PROPERTY_ALARM.
      Parameters:
      l - the listener
    • removePropertyChangeListener

      public void removePropertyChangeListener(String name, PropertyChangeListener l)

      removePropertyChangeListener.

      Parameters:
      name - a String object
      l - a PropertyChangeListener object
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)

      removePropertyChangeListener.

      Parameters:
      l - a PropertyChangeListener 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 - a Severity object
      status - a Status object
    • updateAlarm

      public void updateAlarm(gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify)

      updateAlarm.

      Parameters:
      severity - a Severity object
      status - a Status object
      notify - a boolean
    • getProcessor

      public ValueProcessor getProcessor()

      Getter for the field processor.

      Returns:
      a ValueProcessor object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copyFields

      public void copyFields(Record record)

      copyFields.

      Parameters:
      record - a Record object
    • copyUnitsControlLimits

      public void copyUnitsControlLimits(Record record)

      copyUnitsControlLimits.

      Parameters:
      record - a Record object
    • copyFields

      public void copyFields(MetaData md)

      copyFields.

      Parameters:
      md - a MetaData object
    • setValueAsString

      public void setValueAsString(String value)

      setValueAsString.

      Parameters:
      value - a String object
    • setMinMax

      public void setMinMax(Number min, Number max)

      setMinMax.

      Parameters:
      min - a Number object
      max - a Number object