Package org.scictrl.csshell
Interface Connection<C extends AbstractConnector<?>,T,V>
- Type Parameters:
C- connector implementationT- data typeV- 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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener.voiddestroy()destroy.Returns Connector object responsible for this connection.getDataType.getLastPoop.Returns value from last Poop converted to data type of the connection, if possible.getMetaData.voidgetMetaDataAsync.getName()Returns remote name for this connection.getPoop()getPoop.getStatus.getValue()Synchronously obtains remote value and returns it.getValue.booleanhasLastPoop.booleanisConnected.booleanReturnstrueafter destroy method was called.booleanisReady()Returns true, when this connection object is connected and has received at least one remote update.voidremovePropertyChangeListener.voidsetValue.setValue(T value, ResponseListener<C> l) setValue.voidIt will block this call until this connection is connected or timeout occurs and connection fails.
-
Field Details
-
PROPERTY_POOP
Property name for poop. Used to indicate interest in events which update value in form of Poop object.- See Also:
-
PROPERTY_VALUE
Property name for value. Used to indicate interest in events which update value.- See Also:
-
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
Property name for metaData. Used to indicate interest in events which update metaData structure.- See Also:
-
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
MetaDataobject
-
getMetaDataAsync
getMetaDataAsync.
- Parameters:
l- aPropertyChangeListenerobject
-
getDataType
DataType getDataType()getDataType.
- Returns:
- a
DataTypeobject
-
getValue
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
getPoop.
- Returns:
- a
Poopobject - Throws:
RemoteException- if any.
-
setValue
setValue.
- Parameters:
value- a T object- Throws:
RemoteException- if any.
-
addPropertyChangeListener
addPropertyChangeListener.
- Parameters:
pName- aStringobjectl- aPropertyChangeListenerobject- Throws:
RemoteException- if any.
-
removePropertyChangeListener
removePropertyChangeListener.
- Parameters:
pName- aStringobjectl- aPropertyChangeListenerobject
-
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()Returnstrueafter destroy method was called.- Returns:
trueafter 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
getLastPoop.
- Returns:
- a
Poopobject
-
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
setValue.
- Parameters:
value- a T objectl- aResponseListenerobject- Returns:
- a
Requestobject - Throws:
RemoteException- if any.
-
getValue
getValue.
- Parameters:
l- aResponseListenerobject- Returns:
- a
Requestobject - Throws:
RemoteException- if any.
-
getStatus
Status getStatus()getStatus.
- Returns:
- a
Statusobject
-