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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener.void
destroy()
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.void
getMetaDataAsync.getName()
Returns remote name for this connection.getPoop()
getPoop.getStatus.getValue()
Synchronously obtains remote value and returns it.getValue.boolean
hasLastPoop.boolean
isConnected.boolean
Returnstrue
after destroy method was called.boolean
isReady()
Returns true, when this connection object is connected and has received at least one remote update.void
removePropertyChangeListener.void
setValue.setValue
(T value, ResponseListener<C> l) setValue.void
It 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
MetaData
object
-
getMetaDataAsync
getMetaDataAsync.
- Parameters:
l
- aPropertyChangeListener
object
-
getDataType
DataType getDataType()getDataType.
- Returns:
- a
DataType
object
-
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
Poop
object - Throws:
RemoteException
- if any.
-
setValue
setValue.
- Parameters:
value
- a T object- Throws:
RemoteException
- if any.
-
addPropertyChangeListener
addPropertyChangeListener.
- Parameters:
pName
- aString
objectl
- aPropertyChangeListener
object- Throws:
RemoteException
- if any.
-
removePropertyChangeListener
removePropertyChangeListener.
- Parameters:
pName
- aString
objectl
- aPropertyChangeListener
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()Returnstrue
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
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
setValue.
- Parameters:
value
- a T objectl
- aResponseListener
object- Returns:
- a
Request
object - Throws:
RemoteException
- if any.
-
getValue
getValue.
- Parameters:
l
- aResponseListener
object- Returns:
- a
Request
object - Throws:
RemoteException
- if any.
-
getStatus
Status getStatus()getStatus.
- Returns:
- a
Status
object
-