Interface Connection<C extends AbstractConnector<?>,T,V>

Type Parameters:
C - connector implementation
T - data type
V - vector delivering value, such as DBR
All Known Implementing Classes:
DummyConnection, EPICSConnection

public interface Connection<C extends AbstractConnector<?>,T,V>
Simple easy to use interface for remote value connection. Rquired generics: C - Connector, T - data type, V - vector delivering value, such as DBR.
Author:
igor@scictrl.com
  • Field Details

    • PROPERTY_POOP

      static final String PROPERTY_POOP
      Property name for poop. Used to indicate interest in events which update value in form of Poop object.
      See Also:
    • PROPERTY_VALUE

      static final String PROPERTY_VALUE
      Property name for value. Used to indicate interest in events which update value.
      See Also:
    • PROPERTY_STATUS

      static final String PROPERTY_STATUS
      Property name for status. Used to indicate interest in events which update status, such as connected, disconnected, etc.
      See Also:
    • PROPERTY_META_DATA

      static final String PROPERTY_META_DATA
      Property name for metaData. Used to indicate interest in events which update metaData structure.
      See Also:
    • PROPERTY_ALARM

      static final String PROPERTY_ALARM
      Property name for alarm. Used to indicate interest in events which update alarm states.
      See Also:
  • Method Details

    • getName

      String getName()
      Returns remote name for this connection.
      Returns:
      remote name
    • getConnector

      C getConnector()
      Returns Connector object responsible for this connection.
      Returns:
      a C object
    • getMetaData

      MetaData getMetaData()

      getMetaData.

      Returns:
      a MetaData object
    • getMetaDataAsync

      void getMetaDataAsync(PropertyChangeListener l)

      getMetaDataAsync.

      Parameters:
      l - a PropertyChangeListener object
    • getDataType

      DataType getDataType()

      getDataType.

      Returns:
      a DataType object
    • getValue

      T getValue() throws RemoteException
      Synchronously obtains remote value and returns it. This call is blocked until value is returned.
      Returns:
      remote value
      Throws:
      RemoteException - if retrieving value fails
    • getPoop

      Poop<T,V> getPoop() throws RemoteException

      getPoop.

      Returns:
      a Poop object
      Throws:
      RemoteException - if any.
    • setValue

      void setValue(T value) throws RemoteException

      setValue.

      Parameters:
      value - a T object
      Throws:
      RemoteException - if any.
    • addPropertyChangeListener

      void addPropertyChangeListener(String pName, PropertyChangeListener l) throws RemoteException

      addPropertyChangeListener.

      Parameters:
      pName - a String object
      l - a PropertyChangeListener object
      Throws:
      RemoteException - if any.
    • removePropertyChangeListener

      void removePropertyChangeListener(String pName, PropertyChangeListener l)

      removePropertyChangeListener.

      Parameters:
      pName - a String object
      l - a PropertyChangeListener object
    • destroy

      void destroy()

      destroy.

    • isReady

      boolean isReady()
      Returns true, when this connection object is connected and has received at least one remote update. This means that remote connection is successfully established (CONNECTED status state) and alive (no warnings, alarms or errors states in status). As remote update counts that hasLastPoop() returns true, which is consequence of least one successful get call was made or there is property listener registered on this object and remote monitor has already returned at least one monitor update.
      Returns:
      returns true, when connection is ready to be used
    • isDestroyed

      boolean isDestroyed()
      Returns true after destroy method was called.
      Returns:
      true after destroy method was called
    • isConnected

      boolean isConnected()

      isConnected.

      Returns:
      a boolean
    • waitTillConnected

      void waitTillConnected()
      It will block this call until this connection is connected or timeout occurs and connection fails.
    • hasLastPoop

      boolean hasLastPoop()

      hasLastPoop.

      Returns:
      a boolean
    • getLastPoop

      Poop<T,V> getLastPoop()

      getLastPoop.

      Returns:
      a Poop object
    • getLastValue

      T getLastValue()
      Returns value from last Poop converted to data type of the connection, if possible.
      Returns:
      the last value from last Poop
    • setValue

      Request<C> setValue(T value, ResponseListener<C> l) throws RemoteException

      setValue.

      Parameters:
      value - a T object
      l - a ResponseListener object
      Returns:
      a Request object
      Throws:
      RemoteException - if any.
    • getValue

      Request<C> getValue(ResponseListener<C> l) throws RemoteException

      getValue.

      Parameters:
      l - a ResponseListener object
      Returns:
      a Request object
      Throws:
      RemoteException - if any.
    • getStatus

      Status getStatus()

      getStatus.

      Returns:
      a Status object