dxFeed Graal Native SDK 3.13.0-rc2
Loading...
Searching...
No Matches
CandleWebService

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.

Detailed Description

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 Documentation

◆ dxfg_history_endpoint_builder_t

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.

◆ dxfg_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_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_history_endpoint_t

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.

Enumeration Type Documentation

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

Enumerator
DXFG_HISTORY_ENDPOINT_COMPRESSION_NONE 

The data is not compressed.

DXFG_HISTORY_ENDPOINT_COMPRESSION_ZIP 

The data is compressed with ZIP.

DXFG_HISTORY_ENDPOINT_COMPRESSION_GZIP 

The data is compressed with GZIP.

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

Enumerator
DXFG_HISTORY_ENDPOINT_FORMAT_TEXT 

The data is plain text.

DXFG_HISTORY_ENDPOINT_FORMAT_CSV 

The data is comma-separated values.

DXFG_HISTORY_ENDPOINT_FORMAT_BINARY 

The data is in the binary format.

Function Documentation

◆ dxfg_HistoryEndpoint_Builder_build()

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().

Deprecated
Use dxfg_v4_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_JavaObjectHandler_release()).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_HistoryEndpoint_Builder_withAddress()

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).

Deprecated
Use dxfg_v4_HistoryEndpoint_Builder_withAddress().
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_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_HistoryEndpoint_Builder_withAuthToken()

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).

Deprecated
Use dxfg_v4_HistoryEndpoint_Builder_withAuthToken().
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_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_HistoryEndpoint_Builder_withCompression()

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).

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

◆ dxfg_HistoryEndpoint_Builder_withFormat()

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).

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

◆ dxfg_HistoryEndpoint_Builder_withPassword()

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).

Deprecated
Use dxfg_v4_HistoryEndpoint_Builder_withPassword().
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_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_HistoryEndpoint_Builder_withUserName()

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).

Deprecated
Use dxfg_v4_HistoryEndpoint_Builder_withUserName().
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_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_HistoryEndpoint_getTimeSeries()

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).

Deprecated
Use dxfg_v4_HistoryEndpoint_getTimeSeries().
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_CList_EventType_release().
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_HistoryEndpoint_newBuilder()

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().

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