|
dxFeed Graal Native SDK 3.10.0
|
The client of the history (candle web) service: a request of the time series events of a symbol within a time range over HTTP, configured with a builder. More...
Data Structures | |
| struct | dxfg_history_endpoint_t |
| A handle of a history endpoint, the client of the history service; release it with dxfg_JavaObjectHandler_release(). More... | |
| struct | dxfg_history_endpoint_builder_t |
| A handle of a builder of history endpoints (Java HistoryEndpoint.Builder); release it with dxfg_JavaObjectHandler_release(). More... | |
Typedefs | |
| typedef struct dxfg_history_endpoint_t | dxfg_history_endpoint_t |
| A handle of a history endpoint, the client of the history service; release it with dxfg_JavaObjectHandler_release(). | |
| typedef struct dxfg_history_endpoint_builder_t | dxfg_history_endpoint_builder_t |
| A handle of a builder of history endpoints (Java HistoryEndpoint.Builder); release it with dxfg_JavaObjectHandler_release(). | |
| typedef enum dxfg_history_endpoint_compression_t | dxfg_history_endpoint_compression_t |
| The compression of the data that the history service sends. | |
| typedef enum dxfg_history_endpoint_format_t | dxfg_history_endpoint_format_t |
| The format of the data that the history service sends. | |
Enumerations | |
| enum | dxfg_history_endpoint_compression_t { DXFG_HISTORY_ENDPOINT_COMPRESSION_NONE = 0 , DXFG_HISTORY_ENDPOINT_COMPRESSION_ZIP , DXFG_HISTORY_ENDPOINT_COMPRESSION_GZIP } |
| The compression of the data that the history service sends. More... | |
| enum | dxfg_history_endpoint_format_t { DXFG_HISTORY_ENDPOINT_FORMAT_TEXT = 0 , DXFG_HISTORY_ENDPOINT_FORMAT_CSV , DXFG_HISTORY_ENDPOINT_FORMAT_BINARY } |
| The format of the data that the history service sends. More... | |
Functions | |
| int32_t | dxfg_HistoryEndpoint_newBuilder (graal_isolatethread_t *thread, DXFG_OUT dxfg_history_endpoint_builder_t **builder) |
| Creates a builder of history endpoints with the default settings. | |
| int32_t | dxfg_HistoryEndpoint_getTimeSeries (graal_isolatethread_t *thread, dxfg_history_endpoint_t *endpoint, dxfg_event_clazz_t eventClazz, dxfg_symbol_t *symbol, int64_t fromTime, int64_t toTime, DXFG_OUT dxfg_event_type_list **events) |
| Requests the time series events of a symbol within a time range from the history service. | |
| int32_t | dxfg_HistoryEndpoint_Builder_withAddress (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, const char *address) |
| Sets the address of the history service. | |
| int32_t | dxfg_HistoryEndpoint_Builder_withUserName (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, const char *userName) |
| Sets the user name that the requests to the history service use. | |
| int32_t | dxfg_HistoryEndpoint_Builder_withPassword (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, const char *password) |
| Sets the password that the requests to the history service use. | |
| int32_t | dxfg_HistoryEndpoint_Builder_withAuthToken (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, const char *authToken) |
| Sets the authentication token that the requests to the history service use. | |
| int32_t | dxfg_HistoryEndpoint_Builder_withCompression (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, dxfg_history_endpoint_compression_t compression) |
| Sets the compression of the data that the history service sends. | |
| int32_t | dxfg_HistoryEndpoint_Builder_withFormat (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, dxfg_history_endpoint_format_t format) |
| Sets the format of the data that the history service sends. | |
| int32_t | dxfg_HistoryEndpoint_Builder_build (graal_isolatethread_t *thread, dxfg_history_endpoint_builder_t *builder, DXFG_OUT dxfg_history_endpoint_t **endpoint) |
| Creates a history endpoint with the settings of the builder. | |
The client of the history (candle web) service: a request of the time series events of a symbol within a time range over HTTP, configured with a builder.
dxfg_HistoryEndpoint_newBuilder() creates a builder, the functions dxfg_HistoryEndpoint_Builder_withAddress(), dxfg_HistoryEndpoint_Builder_withUserName() and the other dxfg_HistoryEndpoint_Builder_with* functions set its parameters and dxfg_HistoryEndpoint_Builder_build() creates the endpoint, which dxfg_HistoryEndpoint_getTimeSeries() uses to request the events.
A handle that a function returns is owned by the caller: release it with dxfg_JavaObjectHandler_release() (see the group Javac for the ownership rules). All the functions of this group return DXFG_EXECUTE_SUCCESSFULLY (0) or DXFG_EXECUTE_FAIL (-1) on error, and the result is passed through an [out] parameter; it is not changed on error. A NULL [out] pointer is an error too. dxfg_get_and_clear_thread_exception_t() gives the exception.
| typedef struct dxfg_history_endpoint_builder_t dxfg_history_endpoint_builder_t |
A handle of a builder of history endpoints (Java HistoryEndpoint.Builder); release it with dxfg_JavaObjectHandler_release().
Create it with dxfg_HistoryEndpoint_newBuilder(), set the parameters with the dxfg_HistoryEndpoint_Builder_with*() functions (they change this builder) and create an endpoint with dxfg_HistoryEndpoint_Builder_build(). The builder stays valid after that: it can be changed and used to build more endpoints.
The compression of the data that the history service sends.
Java: HistoryEndpoint.Compression. The compression is requested from the service and the response is decompressed accordingly.
The format of the data that the history service sends.
Java: HistoryEndpoint.Format. The format is requested from the service and the response is parsed accordingly.
| typedef struct dxfg_history_endpoint_t dxfg_history_endpoint_t |
A handle of a history endpoint, the client of the history service; release it with dxfg_JavaObjectHandler_release().
Create it with dxfg_HistoryEndpoint_Builder_build(). The endpoint holds only the settings of the requests: it does not keep a connection open, there is nothing to close. Releasing the handle drops the reference to the settings.
The compression of the data that the history service sends.
Java: HistoryEndpoint.Compression. The compression is requested from the service and the response is decompressed accordingly.
The format of the data that the history service sends.
Java: HistoryEndpoint.Format. The format is requested from the service and the response is parsed accordingly.
| int32_t dxfg_HistoryEndpoint_Builder_build | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| DXFG_OUT dxfg_history_endpoint_t ** | endpoint ) |
Creates a history endpoint with the settings of the builder.
The endpoint takes the address, the user name, the password, the authentication token, the compression and the format that are set in the builder at the moment of the call; later changes of the builder do not affect it. The function does not check that the address is set.
Java: HistoryEndpoint.Builder.build().
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [out] | endpoint | The new endpoint (release the handle with dxfg_JavaObjectHandler_release()). |
| int32_t dxfg_HistoryEndpoint_Builder_withAddress | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| const char * | address ) |
Sets the address of the history service.
The address is the URL of the service without the query: the SDK appends the query of each request to it. The string is copied: the caller keeps its ownership and can free it after the call.
Java: HistoryEndpoint.Builder.withAddress(String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [in] | address | The address of the service: a UTF-8 null-terminated string. |
| int32_t dxfg_HistoryEndpoint_Builder_withAuthToken | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| const char * | authToken ) |
Sets the authentication token that the requests to the history service use.
If the token is not NULL and not empty, each request carries it in the Authorization: Bearer <token> header. The string is copied: the caller keeps its ownership and can free it after the call.
Java: HistoryEndpoint.Builder.withAuthToken(String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [in] | authToken | The authentication token: a UTF-8 null-terminated string. |
| int32_t dxfg_HistoryEndpoint_Builder_withCompression | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| dxfg_history_endpoint_compression_t | compression ) |
Sets the compression of the data that the history service sends.
Java: HistoryEndpoint.Builder.withCompression(HistoryEndpoint.Compression).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [in] | compression | The compression, see dxfg_history_endpoint_compression_t. |
| int32_t dxfg_HistoryEndpoint_Builder_withFormat | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| dxfg_history_endpoint_format_t | format ) |
Sets the format of the data that the history service sends.
Java: HistoryEndpoint.Builder.withFormat(HistoryEndpoint.Format).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [in] | format | The format, see dxfg_history_endpoint_format_t. |
| int32_t dxfg_HistoryEndpoint_Builder_withPassword | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| const char * | password ) |
Sets the password that the requests to the history service use.
The user name and the password are used to open the connection to the service. The string is copied: the caller keeps its ownership and can free it after the call.
Java: HistoryEndpoint.Builder.withPassword(String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [in] | password | The password: a UTF-8 null-terminated string. |
| int32_t dxfg_HistoryEndpoint_Builder_withUserName | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_builder_t * | builder, | ||
| const char * | userName ) |
Sets the user name that the requests to the history service use.
The user name and the password are used to open the connection to the service. The string is copied: the caller keeps its ownership and can free it after the call.
Java: HistoryEndpoint.Builder.withUserName(String).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | builder | The history endpoint's builder. |
| [in] | userName | The user name: a UTF-8 null-terminated string. |
| int32_t dxfg_HistoryEndpoint_getTimeSeries | ( | graal_isolatethread_t * | thread, |
| dxfg_history_endpoint_t * | endpoint, | ||
| dxfg_event_clazz_t | eventClazz, | ||
| dxfg_symbol_t * | symbol, | ||
| int64_t | fromTime, | ||
| int64_t | toTime, | ||
| DXFG_OUT dxfg_event_type_list ** | events ) |
Requests the time series events of a symbol within a time range from the history service.
The function blocks the calling thread while the request is executed and the response is read: it sends a request to the address of the endpoint with the query parameters records (the simple name of the event class), symbols, start and stop (the range), format and compression (the settings of the endpoint), then decompresses and parses the response. It fails if the request, the reading or the parsing fails.
eventClazz must be the class of a time series event (for example DXFG_EVENT_CANDLE or DXFG_EVENT_TIME_AND_SALE); the sources do not say what happens for another class.
Java: HistoryEndpoint.getTimeSeries(Class, Object, Long, Long).
| [in] | thread | The current GraalVM Isolate's thread. |
| [in] | endpoint | The history endpoint. |
| [in] | eventClazz | The class of the events to retrieve. |
| [in] | symbol | The symbol whose time series is requested; its string form is sent to the service. The caller keeps its ownership. |
| [in] | fromTime | The start of the time range, in milliseconds since the Unix epoch. |
| [in] | toTime | The end of the time range, in milliseconds since the Unix epoch. |
| [out] | events | The list of the events of the specified class and symbol within the time range; it can be empty. Release it with dxfg_CList_EventType_release(). |
| int32_t dxfg_HistoryEndpoint_newBuilder | ( | graal_isolatethread_t * | thread, |
| DXFG_OUT dxfg_history_endpoint_builder_t ** | builder ) |
Creates a builder of history endpoints with the default settings.
The default settings are:
The address, the user name, the password and the authentication token are not set.
Java: HistoryEndpoint.newBuilder().
| [in] | thread | The current GraalVM Isolate's thread. |
| [out] | builder | The new builder (release the handle with dxfg_JavaObjectHandler_release()). |