Class InstrumentProfileReader
Reads instrument profiles from the stream using Instrument Profile Format (IPF). Please see Instrument Profile Format documentation for complete description. This reader automatically uses data formats as specified in the stream.
This reader is intended for "one time only" usage: create new instances for new IPF reads. Use InstrumentProfileConnection if support for streaming updates of instrument profiles is needed. For backward compatibility reader can be configured with system property "com.dxfeed.ipf.complete" to control the strategy for missing "##COMPLETE" tag when reading IPF, possible values are:warn
- show warning in the log (default)error
- throw exception (future default)ignore
- do nothing (for backward compatibility)
public class InstrumentProfileReader
- Inheritance
-
InstrumentProfileReader
- Inherited Members
Methods
GetLastModified()
Gets last modification time (in milliseconds) from last ReadFromFile(string) operation or zero if it is unknown.
public long GetLastModified()
Returns
- long
The last modification time.
ReadFromFile(string)
Reads and returns instrument profiles from specified file. This method recognizes data compression formats "zip" and "gzip" automatically. In case of zip the first file entry will be read and parsed as a plain data stream. In case of gzip compressed content will be read and processed. In other cases data considered uncompressed and will be parsed as is.
Authentication information can be supplied to this method as part of URL user info like"http://user:password@host:port/path/file.ipf"
.
This operation updates GetLastModified() and WasComplete().
public List<InstrumentProfile> ReadFromFile(string address)
Parameters
address
stringThe URL of file to read from.
Returns
- List<InstrumentProfile>
The list of instrument profiles.
ReadFromFile(string, AuthToken?)
Reads and returns instrument profiles from specified address with a specified token credentials. This method recognizes data compression formats "zip" and "gzip" automatically. In case of zip the first file entry will be read and parsed as a plain data stream. In case of gzip compressed content will be read and processed. In other cases data considered uncompressed and will be parsed as is.
Specified token take precedence over authentication information that is supplied to this method as part of URL user info like"http://user:password@host:port/path/file.ipf"
.
This operation updates GetLastModified() and WasComplete().
public List<InstrumentProfile> ReadFromFile(string address, AuthToken? token)
Parameters
Returns
- List<InstrumentProfile>
The list of instrument profiles.
ReadFromFile(string, string?, string?)
Reads and returns instrument profiles from specified file. This method recognizes data compression formats "zip" and "gzip" automatically. In case of zip the first file entry will be read and parsed as a plain data stream. In case of gzip compressed content will be read and processed. In other cases data considered uncompressed and will be parsed as is.
Specified user and password take precedence over authentication information that is supplied to this method as part of URL user info like"http://user:password@host:port/path/file.ipf"
.
This operation updates GetLastModified() and WasComplete().
public List<InstrumentProfile> ReadFromFile(string address, string? user, string? password)
Parameters
address
stringThe URL of file to read from.
user
stringThe username (maybe null).
password
stringThe password (maybe null).
Returns
- List<InstrumentProfile>
The list of instrument profiles.
ResolveSourceUrl(string)
Resolves the given address specification into its corresponding URL format, particularly transforming simple "host:port" address specifications into a full HTTP URL.
public static string? ResolveSourceUrl(string address)
Parameters
address
stringThe address specification to be resolved into a URL.
Returns
- string
The resolved URL corresponding to the specified address.
Remarks
If the provided address appears to be a "host:port" pattern without any forward slashes, this method will attempt to convert it to a standardized HTTP URL format targeting an "ipf/all.ipf.gz" endpoint. If the address contains a query parameter (e.g., "host:port?param=value"), the parameter will be preserved in the resulting URL. Addresses that do not fit the "host:port" pattern, or that have invalid port numbers, are returned unchanged.
WasComplete()
Returns true
if IPF was fully read on last ReadFromFile(string) operation.
public bool WasComplete()
Returns
- bool
true
if IPF was fully read; otherwise,false
.