Package uk.ac.gda.client.live.stream
Class LiveStreamConnection
java.lang.Object
uk.ac.gda.client.live.stream.LiveStreamConnection
- All Implemented Interfaces:
AutoCloseable,IConnection,ILiveStreamConnection
An instance of this class encapsulates a connection to a live stream, i.e. a camera, as defined by a
CameraConfiguration and a StreamType.
Publishes OpenConnectionEvent when a connection is created
Instances of this class should be created using LiveStreamConnectionBuilder which will ensure it is attached
to a stream.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAxisMoveListener(LiveStreamConnection.IAxisChangeListener axisMoveListener) voidaddDataListenerToStream(org.eclipse.january.dataset.IDataListener listener) org.eclipse.january.dataset.IDatasetConnectorconnect()voidCall to disconnect any resources which we no longer need.booleanList<org.eclipse.january.dataset.IDataset> getAxes()getId()Returns this connection unique idorg.eclipse.january.dataset.IDatasetConnectorbooleaninthashCode()booleanReturns whether this connection is connected.voidremoveAxisMoveListener(LiveStreamConnection.IAxisChangeListener axisMoveListener) voidremoveDataListenerFromStream(org.eclipse.january.dataset.IDataListener listener) voidsetStream(org.eclipse.january.dataset.IDatasetConnector stream) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.scanning.api.event.core.IConnection
close
-
Method Details
-
getId
Returns this connection unique id- Specified by:
getIdin interfaceILiveStreamConnection- Returns:
- the UUID associated with this connection
-
connect
- Throws:
LiveStreamException
-
disconnect
Description copied from interface:IConnectionCall to disconnect any resources which we no longer need. The resource may have timed out so it might not be connected, in that case it silently returns. Note, that the methodIConnection.close(), inherited fromAutoCloseablecalls this method, which means that if an object of a class implementingIConnectionis used with a try-with-resources block this method will be called automatically when exiting that block.- Specified by:
disconnectin interfaceIConnection- Throws:
LiveStreamException
-
addAxisMoveListener
- Specified by:
addAxisMoveListenerin interfaceILiveStreamConnection
-
removeAxisMoveListener
- Specified by:
removeAxisMoveListenerin interfaceILiveStreamConnection
-
addDataListenerToStream
public void addDataListenerToStream(org.eclipse.january.dataset.IDataListener listener) throws LiveStreamException - Specified by:
addDataListenerToStreamin interfaceILiveStreamConnection- Throws:
LiveStreamException
-
removeDataListenerFromStream
public void removeDataListenerFromStream(org.eclipse.january.dataset.IDataListener listener) - Specified by:
removeDataListenerFromStreamin interfaceILiveStreamConnection
-
getCameraConfig
- Specified by:
getCameraConfigin interfaceILiveStreamConnection
-
getStreamType
- Specified by:
getStreamTypein interfaceILiveStreamConnection
-
getAxes
-
isConnected
public boolean isConnected()Description copied from interface:IConnectionReturns whether this connection is connected. This method returnstrueuntil disconnect is called, even if the connection is created lazily.- Specified by:
isConnectedin interfaceIConnection- Returns:
trueif connected,falseotherwise
-
hasAxesProvider
public boolean hasAxesProvider() -
getStream
public org.eclipse.january.dataset.IDatasetConnector getStream() -
setStream
public void setStream(org.eclipse.january.dataset.IDatasetConnector stream) -
hashCode
public int hashCode() -
equals
-
toString
-