dxFeed Graal Native SDK 3.12.0
Loading...
Searching...
No Matches
CandleWebService (v4)

The v4 functions and type names of the group CandleWebService. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions. More...

Typedefs

typedef dxfg_history_endpoint_t dxfg_v4_history_endpoint_t
 A handle of a history endpoint, the client of the history service; release it with dxfg_JavaObjectHandler_release().
typedef dxfg_history_endpoint_builder_t dxfg_v4_history_endpoint_builder_t
 A handle of a builder of history endpoints (Java HistoryEndpoint.Builder); release it with dxfg_JavaObjectHandler_release().
typedef dxfg_history_endpoint_compression_t dxfg_v4_history_endpoint_compression_t
 The compression of the data that the history service sends.
typedef dxfg_history_endpoint_format_t dxfg_v4_history_endpoint_format_t
 The format of the data that the history service sends.

Functions

int32_t dxfg_v4_HistoryEndpoint_newBuilder (graal_isolatethread_t *thread, DXFG_OUT dxfg_v4_history_endpoint_builder_t **builder)
 Creates a builder of history endpoints with the default settings.
int32_t dxfg_v4_HistoryEndpoint_getTimeSeries (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_t *endpoint, dxfg_v4_event_clazz_t eventClazz, dxfg_v4_symbol_t *symbol, int64_t fromTime, int64_t toTime, DXFG_OUT dxfg_v4_event_type_list **events)
 Requests the time series events of a symbol within a time range from the history service.
int32_t dxfg_v4_HistoryEndpoint_Builder_withAddress (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, const char *address)
 Sets the address of the history service.
int32_t dxfg_v4_HistoryEndpoint_Builder_withUserName (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, const char *userName)
 Sets the user name that the requests to the history service use.
int32_t dxfg_v4_HistoryEndpoint_Builder_withPassword (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, const char *password)
 Sets the password that the requests to the history service use.
int32_t dxfg_v4_HistoryEndpoint_Builder_withAuthToken (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, const char *authToken)
 Sets the authentication token that the requests to the history service use.
int32_t dxfg_v4_HistoryEndpoint_Builder_withCompression (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, dxfg_v4_history_endpoint_compression_t compression)
 Sets the compression of the data that the history service sends.
int32_t dxfg_v4_HistoryEndpoint_Builder_withFormat (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, dxfg_v4_history_endpoint_format_t format)
 Sets the format of the data that the history service sends.
int32_t dxfg_v4_HistoryEndpoint_Builder_build (graal_isolatethread_t *thread, dxfg_v4_history_endpoint_builder_t *builder, DXFG_OUT dxfg_v4_history_endpoint_t **endpoint)
 Creates a history endpoint with the settings of the builder.

Detailed Description

The v4 functions and type names of the group CandleWebService. Every function returns DXFG_EXECUTE_SUCCESSFULLY or DXFG_EXECUTE_FAIL and writes its result to a DXFG_OUT parameter, see The v4 functions.

Typedef Documentation

◆ dxfg_v4_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.

◆ dxfg_v4_history_endpoint_compression_t

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.

◆ dxfg_v4_history_endpoint_format_t

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.

◆ dxfg_v4_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.

Function Documentation

◆ dxfg_v4_HistoryEndpoint_Builder_build()

int32_t dxfg_v4_HistoryEndpoint_Builder_build ( graal_isolatethread_t * thread,
dxfg_v4_history_endpoint_builder_t * builder,
DXFG_OUT dxfg_v4_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().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[out]endpointThe new endpoint (release the handle with dxfg_v4_JavaObjectHandler_release()).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_Builder_withAddress()

int32_t dxfg_v4_HistoryEndpoint_Builder_withAddress ( graal_isolatethread_t * thread,
dxfg_v4_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).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[in]addressThe address of the service: a UTF-8 null-terminated string.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_Builder_withAuthToken()

int32_t dxfg_v4_HistoryEndpoint_Builder_withAuthToken ( graal_isolatethread_t * thread,
dxfg_v4_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).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[in]authTokenThe authentication token: a UTF-8 null-terminated string.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_Builder_withCompression()

int32_t dxfg_v4_HistoryEndpoint_Builder_withCompression ( graal_isolatethread_t * thread,
dxfg_v4_history_endpoint_builder_t * builder,
dxfg_v4_history_endpoint_compression_t compression )

Sets the compression of the data that the history service sends.

Java: HistoryEndpoint.Builder.withCompression(HistoryEndpoint.Compression).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[in]compressionThe compression, see dxfg_v4_history_endpoint_compression_t.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_Builder_withFormat()

int32_t dxfg_v4_HistoryEndpoint_Builder_withFormat ( graal_isolatethread_t * thread,
dxfg_v4_history_endpoint_builder_t * builder,
dxfg_v4_history_endpoint_format_t format )

Sets the format of the data that the history service sends.

Java: HistoryEndpoint.Builder.withFormat(HistoryEndpoint.Format).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[in]formatThe format, see dxfg_v4_history_endpoint_format_t.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_Builder_withPassword()

int32_t dxfg_v4_HistoryEndpoint_Builder_withPassword ( graal_isolatethread_t * thread,
dxfg_v4_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).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[in]passwordThe password: a UTF-8 null-terminated string.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_Builder_withUserName()

int32_t dxfg_v4_HistoryEndpoint_Builder_withUserName ( graal_isolatethread_t * thread,
dxfg_v4_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).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]builderThe history endpoint's builder.
[in]userNameThe user name: a UTF-8 null-terminated string.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_getTimeSeries()

int32_t dxfg_v4_HistoryEndpoint_getTimeSeries ( graal_isolatethread_t * thread,
dxfg_v4_history_endpoint_t * endpoint,
dxfg_v4_event_clazz_t eventClazz,
dxfg_v4_symbol_t * symbol,
int64_t fromTime,
int64_t toTime,
DXFG_OUT dxfg_v4_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).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe history endpoint.
[in]eventClazzThe class of the events to retrieve.
[in]symbolThe symbol whose time series is requested; its string form is sent to the service. The caller keeps its ownership.
[in]fromTimeThe start of the time range, in milliseconds since the Unix epoch.
[in]toTimeThe end of the time range, in milliseconds since the Unix epoch.
[out]eventsThe list of the events of the specified class and symbol within the time range; it can be empty. Release it with dxfg_v4_event_type_list_release().
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.

◆ dxfg_v4_HistoryEndpoint_newBuilder()

int32_t dxfg_v4_HistoryEndpoint_newBuilder ( graal_isolatethread_t * thread,
DXFG_OUT dxfg_v4_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().

Parameters
[in]threadThe current GraalVM Isolate's thread.
[out]builderThe new builder (release the handle with dxfg_v4_JavaObjectHandler_release()).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_v4_get_and_clear_thread_exception() to determine if an exception was thrown.