Class InstrumentProfileConnection
Connects to an instrument profile URL and reads instrument profiles with support of streaming live updates. Please see Instrument Profile Format documentation for complete description.
The key different between this class and InstrumentProfileReader is that the later just reads a snapshot of a set of instrument profiles, while this classes allows to track live updates, e.g. addition and removal of instruments. To use this class you need an address of the data source from you data provider. The name of the IPF file can also serve as an address for debugging purposes. The recommended usage of this class to receive a live stream of instrument profile updates is:public class InstrumentProfileConnection
- Inheritance
-
InstrumentProfileConnection
- Inherited Members
Methods
Close()
Closes this instrument profile connection.
public void Close()
CreateConnection(string, InstrumentProfileCollector)
Creates instrument profile connection with a specified address and collector. Address may be just "<host>:<port>" of server, URL, or a file path. The "[update=<period>]" clause can be optionally added at the end of the address to specify an {@link #getUpdatePeriod() update period} via an address string. Default update period is 1 minute.
public static InstrumentProfileConnection CreateConnection(string address, InstrumentProfileCollector collector)
Parameters
address
stringThe connection address.
collector
InstrumentProfileCollectorThe instrument profile collector to push updates into.
Returns
- InstrumentProfileConnection
New instrument profile connection.
GetAddress()
Returns the address of this instrument profile connection. It does not include additional options specified as part of the address.
public string GetAddress()
Returns
- string
The address of this instrument profile connection.
GetLastModified()
Returns last modification time (in milliseconds) of instrument profiles or zero if it is unknown. Note, that while the time is represented in milliseconds, the actual granularity of time here is a second.
public long GetLastModified()
Returns
- long
Last modification time (in milliseconds) of instrument profiles or zero if it is unknown.
GetUpdatePeriod()
Returns update period in milliseconds. It is period of an update check when the instrument profiles source does not support live updates and/or when connection is dropped.
public long GetUpdatePeriod()
Returns
- long
The update period in milliseconds.
SetUpdatePeriod(long)
Changes update period in milliseconds.
public void SetUpdatePeriod(long updatePeriod)
Parameters
updatePeriod
longThe update period in milliseconds.
Start()
Starts this instrument profile connection.
public void Start()