dxFeed Graal Native SDK 3.17.0-rc1
Loading...
Searching...
No Matches
Endpoint

The endpoint (Java DXEndpoint): a connection to a data feed or to a publisher, its role and state, and the access to its feed and publisher. More...

Topics

 Endpoint builder
 The builder of endpoints (Java DXEndpoint.Builder).

Data Structures

struct  dxfg_endpoint_t
 A handle of a Java DXEndpoint object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_endpoint_builder_t
 A handle of a Java DXEndpoint.Builder object; release it with dxfg_JavaObjectHandler_release(). More...
struct  dxfg_endpoint_state_change_listener_t
 A handle of a Java PropertyChangeListener object that reports the state changes of an endpoint; release it with dxfg_JavaObjectHandler_release(). More...

Typedefs

typedef struct dxfg_feed_t dxfg_feed_t
 Forward declaration of the handle of a Java DXFeed object (see dxfg_feed.h): the result of dxfg_DXEndpoint_getFeed().
typedef struct dxfg_publisher_t dxfg_publisher_t
 Forward declaration of the handle of a Java DXPublisher object (see dxfg_publisher.h): the result of dxfg_DXEndpoint_getPublisher().
typedef struct dxfg_event_clazz_list_t dxfg_event_clazz_list_t
 Forward declaration of the list of event classes (see dxfg_events.h): the result of dxfg_DXEndpoint_getEventTypes().
typedef struct dxfg_endpoint_t dxfg_endpoint_t
 A handle of a Java DXEndpoint object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_endpoint_builder_t dxfg_endpoint_builder_t
 A handle of a Java DXEndpoint.Builder object; release it with dxfg_JavaObjectHandler_release().
typedef struct dxfg_endpoint_state_change_listener_t dxfg_endpoint_state_change_listener_t
 A handle of a Java PropertyChangeListener object that reports the state changes of an endpoint; release it with dxfg_JavaObjectHandler_release().
typedef enum dxfg_endpoint_role_t dxfg_endpoint_role_t
 The role of an endpoint: it is specified when the endpoint is created and cannot be changed afterwards.
typedef enum dxfg_endpoint_state_t dxfg_endpoint_state_t
 The state of an endpoint, see dxfg_DXEndpoint_getState().
typedef void(*) dxfg_endpoint_state_change_listener_func(graal_isolatethread_t *thread, dxfg_endpoint_state_t old_state, dxfg_endpoint_state_t new_state, void *user_data)
 The function of a dxfg_endpoint_state_change_listener_t: called when the state of the endpoint changes.

Enumerations

enum  dxfg_endpoint_role_t {
  DXFG_ENDPOINT_ROLE_FEED = 0 , DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED , DXFG_ENDPOINT_ROLE_STREAM_FEED , DXFG_ENDPOINT_ROLE_PUBLISHER ,
  DXFG_ENDPOINT_ROLE_STREAM_PUBLISHER , DXFG_ENDPOINT_ROLE_LOCAL_HUB
}
 The role of an endpoint: it is specified when the endpoint is created and cannot be changed afterwards. More...
enum  dxfg_endpoint_state_t { DXFG_ENDPOINT_STATE_NOT_CONNECTED = 0 , DXFG_ENDPOINT_STATE_CONNECTING , DXFG_ENDPOINT_STATE_CONNECTED , DXFG_ENDPOINT_STATE_CLOSED }
 The state of an endpoint, see dxfg_DXEndpoint_getState(). More...

Functions

dxfg_endpoint_t * dxfg_DXEndpoint_getInstance (graal_isolatethread_t *thread)
 Returns the default application-wide singleton endpoint with the DXFG_ENDPOINT_ROLE_FEED role, the same one that dxfg_DXFeed_getInstance() uses.
dxfg_endpoint_t * dxfg_DXEndpoint_getInstance2 (graal_isolatethread_t *thread, dxfg_endpoint_role_t role)
 Creates a new endpoint with the given role on every call, the same as dxfg_DXEndpoint_create2().
dxfg_endpoint_t * dxfg_DXEndpoint_create (graal_isolatethread_t *thread)
 Creates a new endpoint with the DXFG_ENDPOINT_ROLE_FEED role.
dxfg_endpoint_t * dxfg_DXEndpoint_create2 (graal_isolatethread_t *thread, dxfg_endpoint_role_t role)
 Creates a new endpoint with the given role.
int32_t dxfg_DXEndpoint_close (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Closes the endpoint: disconnects it and releases its resources. The endpoint cannot be used after that.
int32_t dxfg_DXEndpoint_closeAndAwaitTermination (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Closes the endpoint and waits until all the data processing and the scheduled notifications are completed.
dxfg_endpoint_role_t dxfg_DXEndpoint_getRole (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Returns the role of the endpoint.
int32_t dxfg_DXEndpoint_user (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, const char *user)
 Sets the user name of the endpoint.
int32_t dxfg_DXEndpoint_password (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, const char *password)
 Sets the password of the endpoint.
int32_t dxfg_DXEndpoint_connect (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, const char *address)
 Connects the endpoint to the remote address.
int32_t dxfg_DXEndpoint_reconnect (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Terminates all the network connections of the endpoint and initiates connecting again with the same address.
int32_t dxfg_DXEndpoint_disconnect (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Terminates all the remote network connections of the endpoint.
int32_t dxfg_DXEndpoint_disconnectAndClear (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Terminates all the remote network connections of the endpoint and clears the stored data.
int32_t dxfg_DXEndpoint_awaitProcessed (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Waits until the endpoint stops processing data (becomes quiescent).
int32_t dxfg_DXEndpoint_awaitNotConnected (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Waits until the state of the endpoint becomes DXFG_ENDPOINT_STATE_NOT_CONNECTED or DXFG_ENDPOINT_STATE_CLOSED.
dxfg_endpoint_state_t dxfg_DXEndpoint_getState (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Returns the state of the endpoint.
int32_t dxfg_DXEndpoint_addStateChangeListener (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_endpoint_state_change_listener_t *listener)
 Adds the state change listener (see dxfg_PropertyChangeListener_new()).
int32_t dxfg_DXEndpoint_removeStateChangeListener (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_endpoint_state_change_listener_t *listener)
 Removes the state change listener that was added with dxfg_DXEndpoint_addStateChangeListener().
dxfg_feed_t * dxfg_DXEndpoint_getFeed (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Returns the feed of the endpoint.
dxfg_publisher_t * dxfg_DXEndpoint_getPublisher (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Returns the publisher of the endpoint.
int32_t dxfg_DXEndpoint_executor (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_executor_t *executor)
 Changes the executor of the endpoint's notifications.
dxfg_event_clazz_list_t * dxfg_DXEndpoint_getEventTypes (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint)
 Returns the event types that the endpoint supports.
int32_t dxfg_DXEndpoint_getRequestedAggregationPeriod (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, DXFG_OUT dxfg_time_period_t **period)
 Returns the aggregation period that the endpoint requests from the server.
int32_t dxfg_DXEndpoint_getRequestedAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, DXFG_OUT int64_t *period)
 Returns the aggregation period (in millis) that the endpoint requests from the server.
int32_t dxfg_DXEndpoint_setRequestedAggregationPeriod (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, dxfg_time_period_t *period)
 Sets the aggregation period that the endpoint requests from the server.
int32_t dxfg_DXEndpoint_setRequestedAggregationPeriodMillis (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, int64_t period)
 Sets the aggregation period (in millis) that the endpoint requests from the server.
int32_t dxfg_DXEndpoint_getAggregationPeriodInfo (graal_isolatethread_t *thread, dxfg_endpoint_t *endpoint, DXFG_OUT int64_t *min, DXFG_OUT int64_t *max)
 Returns the aggregation period that the servers apply, over all connections of the endpoint.
dxfg_endpoint_state_change_listener_t * dxfg_PropertyChangeListener_new (graal_isolatethread_t *thread, dxfg_endpoint_state_change_listener_func user_func, void *user_data)
 Creates a new endpoint state change listener.

Detailed Description

The endpoint (Java DXEndpoint): a connection to a data feed or to a publisher, its role and state, and the access to its feed and publisher.

The ownership rules of the handles, the strings and the lists are described in the group Javac.

A typical life cycle of an endpoint:

  1. Create it with dxfg_DXEndpoint_Builder_build() (see the group Endpoint builder), dxfg_DXEndpoint_create() or dxfg_DXEndpoint_create2(). The default endpoint of the process is returned by dxfg_DXEndpoint_getInstance().
  2. Optionally add a state change listener (dxfg_PropertyChangeListener_new(), dxfg_DXEndpoint_addStateChangeListener()) and set the credentials (dxfg_DXEndpoint_user(), dxfg_DXEndpoint_password()).
  3. Connect with dxfg_DXEndpoint_connect() and take the feed (dxfg_DXEndpoint_getFeed()) or the publisher (dxfg_DXEndpoint_getPublisher()).
  4. Close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and release all the handles with dxfg_JavaObjectHandler_release(). Releasing a handle does not close the endpoint. An endpoint that stays open keeps its threads running: close all of them with dxfg_system_close_all_and_await_termination() before graal_tear_down_isolate().

Typedef Documentation

◆ dxfg_endpoint_builder_t

typedef struct dxfg_endpoint_builder_t dxfg_endpoint_builder_t

A handle of a Java DXEndpoint.Builder object; release it with dxfg_JavaObjectHandler_release().

Create it with dxfg_DXEndpoint_newBuilder(). The endpoints that the builder has built are independent of it: releasing the builder's handle does not affect them.

Javadoc

◆ dxfg_endpoint_role_t

The role of an endpoint: it is specified when the endpoint is created and cannot be changed afterwards.

The role defines what dxfg_DXEndpoint_connect() connects to and which of dxfg_DXEndpoint_getFeed() and dxfg_DXEndpoint_getPublisher() is meaningful. The default role is DXFG_ENDPOINT_ROLE_FEED.

Java: DXEndpoint.Role.

Javadoc

◆ dxfg_endpoint_state_change_listener_func

typedef void(*) dxfg_endpoint_state_change_listener_func(graal_isolatethread_t *thread, dxfg_endpoint_state_t old_state, dxfg_endpoint_state_t new_state, void *user_data)

The function of a dxfg_endpoint_state_change_listener_t: called when the state of the endpoint changes.

The function is called by a thread of the executor of the endpoint (the default thread pool or the executor that was set with dxfg_DXEndpoint_Builder_withExecutor()), not by the thread that added the listener or changed the state. A change is reported from the last reported state to the current one, so the fast changes are coalesced (see dxfg_DXEndpoint_addStateChangeListener()). The states are passed by value, there is nothing to release. Do not call dxfg_DXEndpoint_closeAndAwaitTermination() of the same endpoint from the function.

Java: PropertyChangeListener.propertyChange(PropertyChangeEvent).

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]old_stateThe previous state of the endpoint.
[in]new_stateThe new state of the endpoint.
[in]user_dataThe pointer that was passed to dxfg_PropertyChangeListener_new(); the SDK does not use it.

◆ dxfg_endpoint_state_change_listener_t

typedef struct dxfg_endpoint_state_change_listener_t dxfg_endpoint_state_change_listener_t

A handle of a Java PropertyChangeListener object that reports the state changes of an endpoint; release it with dxfg_JavaObjectHandler_release().

The listener calls a dxfg_endpoint_state_change_listener_func when the state of an endpoint to which it is added changes. Create it with dxfg_PropertyChangeListener_new() and add it with dxfg_DXEndpoint_addStateChangeListener(). The last handle of the listener that is released deactivates the listener: its function is not called anymore.

Javadoc

◆ dxfg_endpoint_state_t

The state of an endpoint, see dxfg_DXEndpoint_getState().

An endpoint is created DXFG_ENDPOINT_STATE_NOT_CONNECTED, unless it connects on creation (see dxfg_DXEndpoint_Builder_build()). dxfg_DXEndpoint_connect() makes it DXFG_ENDPOINT_STATE_CONNECTING, the established connection makes it DXFG_ENDPOINT_STATE_CONNECTED, a lost network connection returns it to DXFG_ENDPOINT_STATE_CONNECTING. DXFG_ENDPOINT_STATE_CLOSED is the final state.

Java: DXEndpoint.State.

Javadoc

◆ dxfg_endpoint_t

typedef struct dxfg_endpoint_t dxfg_endpoint_t

A handle of a Java DXEndpoint object; release it with dxfg_JavaObjectHandler_release().

Create it with dxfg_DXEndpoint_Builder_build(), dxfg_DXEndpoint_create(), dxfg_DXEndpoint_create2() or get the default one with dxfg_DXEndpoint_getInstance(). Releasing the handle does not close the endpoint: call dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination().

Javadoc

◆ dxfg_event_clazz_list_t

typedef struct dxfg_event_clazz_list_t dxfg_event_clazz_list_t

Forward declaration of the list of event classes (see dxfg_events.h): the result of dxfg_DXEndpoint_getEventTypes().

◆ dxfg_feed_t

typedef struct dxfg_feed_t dxfg_feed_t

Forward declaration of the handle of a Java DXFeed object (see dxfg_feed.h): the result of dxfg_DXEndpoint_getFeed().

◆ dxfg_publisher_t

typedef struct dxfg_publisher_t dxfg_publisher_t

Forward declaration of the handle of a Java DXPublisher object (see dxfg_publisher.h): the result of dxfg_DXEndpoint_getPublisher().

Enumeration Type Documentation

◆ dxfg_endpoint_role_t

The role of an endpoint: it is specified when the endpoint is created and cannot be changed afterwards.

The role defines what dxfg_DXEndpoint_connect() connects to and which of dxfg_DXEndpoint_getFeed() and dxfg_DXEndpoint_getPublisher() is meaningful. The default role is DXFG_ENDPOINT_ROLE_FEED.

Java: DXEndpoint.Role.

Javadoc

Enumerator
DXFG_ENDPOINT_ROLE_FEED 

Connects to a remote data feed provider; optimized for real-time or delayed data. The default role. The events are conflated when the event processing cannot keep up.

DXFG_ENDPOINT_ROLE_ON_DEMAND_FEED 

Similar to DXFG_ENDPOINT_ROLE_FEED, but only for the replay of historical data with the on-demand service: it is not connected to the data provider until the replay is started. It cannot be connected to an ordinary data feed.

DXFG_ENDPOINT_ROLE_STREAM_FEED 

Similar to DXFG_ENDPOINT_ROLE_FEED, but designed for bulk parsing of data from files: the events are not conflated and not skipped and are processed as fast as possible. The last event requests do not work in this role.

DXFG_ENDPOINT_ROLE_PUBLISHER 

Connects to a remote publisher hub or creates a publisher on the local host; the publisher of the endpoint publishes the events to all the connected feeds. The last event requests and the time series subscription do not work in this role.

DXFG_ENDPOINT_ROLE_STREAM_PUBLISHER 

Similar to DXFG_ENDPOINT_ROLE_PUBLISHER, but designed for bulk publishing: the events are not conflated and not skipped and are processed as fast as possible.

DXFG_ENDPOINT_ROLE_LOCAL_HUB 

A local hub without the network connections: the events published with the publisher of the endpoint are delivered to the feed of the same endpoint only.

◆ dxfg_endpoint_state_t

The state of an endpoint, see dxfg_DXEndpoint_getState().

An endpoint is created DXFG_ENDPOINT_STATE_NOT_CONNECTED, unless it connects on creation (see dxfg_DXEndpoint_Builder_build()). dxfg_DXEndpoint_connect() makes it DXFG_ENDPOINT_STATE_CONNECTING, the established connection makes it DXFG_ENDPOINT_STATE_CONNECTED, a lost network connection returns it to DXFG_ENDPOINT_STATE_CONNECTING. DXFG_ENDPOINT_STATE_CLOSED is the final state.

Java: DXEndpoint.State.

Javadoc

Enumerator
DXFG_ENDPOINT_STATE_NOT_CONNECTED 

The endpoint is not connected to a remote endpoint: it is just created, or was disconnected, or a file that it read is finished.

DXFG_ENDPOINT_STATE_CONNECTING 

dxfg_DXEndpoint_connect() was called, but the connection is not established yet or was lost.

DXFG_ENDPOINT_STATE_CONNECTED 

The connection to a remote endpoint is established.

DXFG_ENDPOINT_STATE_CLOSED 

The endpoint was closed by dxfg_DXEndpoint_close(); no connection can be made anymore.

Function Documentation

◆ dxfg_DXEndpoint_addStateChangeListener()

int32_t dxfg_DXEndpoint_addStateChangeListener ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_endpoint_state_change_listener_t * listener )

Adds the state change listener (see dxfg_PropertyChangeListener_new()).

The state changes are delivered by a single task on the endpoint's executor that reports the change from the last reported state to the current one, so the fast changes are coalesced (e.g. DXFG_ENDPOINT_STATE_NOT_CONNECTED -> DXFG_ENDPOINT_STATE_CONNECTED without DXFG_ENDPOINT_STATE_CONNECTING). A notification may come after dxfg_DXEndpoint_close() or dxfg_DXEndpoint_removeStateChangeListener() returns.

The listener stays added until it is removed with dxfg_DXEndpoint_removeStateChangeListener(); releasing the last handle of the listener only deactivates it.

Java: DXEndpoint.addStateChangeListener(PropertyChangeListener).

Deprecated
Use dxfg_v4_DXEndpoint_addStateChangeListener().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]listenerThe listener. The caller keeps its handle.
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_DXEndpoint_awaitNotConnected()

int32_t dxfg_DXEndpoint_awaitNotConnected ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Waits until the state of the endpoint becomes DXFG_ENDPOINT_STATE_NOT_CONNECTED or DXFG_ENDPOINT_STATE_CLOSED.

It is the signal that the files opened with dxfg_DXEndpoint_connect() (file:... addresses) were finished reading, but not necessarily completely processed by the subscription listeners. Call dxfg_DXEndpoint_closeAndAwaitTermination() after it returns to make sure that all the processing has completed.

The function blocks the calling thread. With a single-threaded executor of the endpoint, do not call it from the executor's thread (e.g. from a listener): it would wait forever.

Java: DXEndpoint.awaitNotConnected().

Deprecated
Use dxfg_v4_DXEndpoint_awaitNotConnected().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also if the waiting thread is interrupted). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_awaitProcessed()

int32_t dxfg_DXEndpoint_awaitProcessed ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Waits until the endpoint stops processing data (becomes quiescent).

It is important when data is written to a file with a tape:... address: wait for it to make sure that all the published data was written before closing the endpoint.

The function blocks the calling thread. With a single-threaded executor of the endpoint, do not call it from the executor's thread (e.g. from a listener): it would wait forever.

Java: DXEndpoint.awaitProcessed().

Deprecated
Use dxfg_v4_DXEndpoint_awaitProcessed().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also if the waiting thread is interrupted). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_close()

int32_t dxfg_DXEndpoint_close ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Closes the endpoint: disconnects it and releases its resources. The endpoint cannot be used after that.

The state of the endpoint becomes DXFG_ENDPOINT_STATE_CLOSED immediately.

The function does not wait for the notifications that are already scheduled: a state change listener (including the change to DXFG_ENDPOINT_STATE_CLOSED) or an event listener may still be called after it returns. Use dxfg_DXEndpoint_closeAndAwaitTermination() to wait for them, or dxfg_JavaObjectHandler_release() of the listener to stop its calls (see dxfg_JavaObjectHandler_release()).

Java: DXEndpoint.close().

Deprecated
Use dxfg_v4_DXEndpoint_close().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
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_DXEndpoint_closeAndAwaitTermination()

int32_t dxfg_DXEndpoint_closeAndAwaitTermination ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Closes the endpoint and waits until all the data processing and the scheduled notifications are completed.

It does the same as dxfg_DXEndpoint_close() and blocks until the outstanding tasks of the endpoint are finished. It is designed for the DXFG_ENDPOINT_ROLE_STREAM_FEED role, after dxfg_DXEndpoint_awaitNotConnected() returns, to make sure that a file was completely processed.

Do not call it from a listener of this endpoint: it would wait for the notification that is calling it.

Java: DXEndpoint.closeAndAwaitTermination().

Deprecated
Use dxfg_v4_DXEndpoint_closeAndAwaitTermination().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also if the waiting thread is interrupted). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_connect()

int32_t dxfg_DXEndpoint_connect ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
const char * address )

Connects the endpoint to the remote address.

The previously established connections are closed if the new address is different from the old one. The function does nothing if the address does not change or if the endpoint is closed. Otherwise, the state of the endpoint immediately becomes DXFG_ENDPOINT_STATE_CONNECTING.

The function does not wait until the connection is established: it is established asynchronously. It waits only until the state change listeners have processed the change to DXFG_ENDPOINT_STATE_CONNECTING.

The address string comes with the market data vendor agreement, for example host:port to connect to a server with TCP/IP, or :port to listen for a connection. A malformed address or a NULL address is an error. For the services that require credentials call dxfg_DXEndpoint_user() and dxfg_DXEndpoint_password() first.

Java: DXEndpoint.connect(String).

Deprecated
Use dxfg_v4_DXEndpoint_connect().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]addressThe address of the data source, a NUL-terminated UTF-8 string; the SDK copies it.
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_DXEndpoint_create()

dxfg_endpoint_t * dxfg_DXEndpoint_create ( graal_isolatethread_t * thread)

Creates a new endpoint with the DXFG_ENDPOINT_ROLE_FEED role.

Java: DXEndpoint.create().

Deprecated
Use dxfg_v4_DXEndpoint_create().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The new endpoint, or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. The caller owns the endpoint: close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and free its handle with dxfg_JavaObjectHandler_release().

◆ dxfg_DXEndpoint_create2()

dxfg_endpoint_t * dxfg_DXEndpoint_create2 ( graal_isolatethread_t * thread,
dxfg_endpoint_role_t role )

Creates a new endpoint with the given role.

Java: DXEndpoint.create(DXEndpoint.Role).

Deprecated
Use dxfg_v4_DXEndpoint_createWithRole().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]roleThe role of the endpoint.
Returns
The new endpoint, or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. The caller owns the endpoint: close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and free its handle with dxfg_JavaObjectHandler_release().

◆ dxfg_DXEndpoint_disconnect()

int32_t dxfg_DXEndpoint_disconnect ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Terminates all the remote network connections of the endpoint.

The function does nothing if the endpoint is closed. Otherwise, the state of the endpoint immediately becomes DXFG_ENDPOINT_STATE_NOT_CONNECTED. The resources of the endpoint are not released: use dxfg_DXEndpoint_close() for that.

Java: DXEndpoint.disconnect().

Deprecated
Use dxfg_v4_DXEndpoint_disconnect().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
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_DXEndpoint_disconnectAndClear()

int32_t dxfg_DXEndpoint_disconnectAndClear ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Terminates all the remote network connections of the endpoint and clears the stored data.

The function does nothing if the endpoint is closed. Otherwise, the state of the endpoint immediately becomes DXFG_ENDPOINT_STATE_NOT_CONNECTED. The resources of the endpoint are not released: use dxfg_DXEndpoint_close() for that.

Java: DXEndpoint.disconnectAndClear().

Deprecated
Use dxfg_v4_DXEndpoint_disconnectAndClear().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
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_DXEndpoint_executor()

int32_t dxfg_DXEndpoint_executor ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_executor_t * executor )

Changes the executor of the endpoint's notifications.

The executor runs all the asynchronous interaction with the user code: event processing, state changes, etc.

Call it before dxfg_DXEndpoint_getFeed() (and before the other functions that use the endpoint's feed, e.g. dxfg_OnDemandService_getInstance2()). Otherwise, the feed keeps using the default executor, which is shut down, and the last events requests (dxfg_DXFeed_getLastEventPromise(), etc.) never complete (a RejectedExecutionException is logged).

The executor must not reject the submitted tasks. A NULL executor is an error.

Java: DXEndpoint.executor(Executor).

Deprecated
Use dxfg_v4_DXEndpoint_Builder_withExecutor(). The first call logs a deprecation warning.
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]executorThe executor. The endpoint does not take the handle: free it with dxfg_JavaObjectHandler_release() when it is no longer needed.
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_DXEndpoint_getAggregationPeriodInfo()

int32_t dxfg_DXEndpoint_getAggregationPeriodInfo ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
DXFG_OUT int64_t * min,
DXFG_OUT int64_t * max )

Returns the aggregation period that the servers apply, over all connections of the endpoint.

The servers report the period when the connection is established. Both bounds are negative (unknown) until then, and when no server reports the period (e.g. a local hub, a publisher or an older server).

Java: DXEndpoint.getAggregationPeriodInfo(), TimePeriodInfo.getMin(), TimePeriodInfo.getMax().

Deprecated
Use dxfg_v4_DXEndpoint_getAggregationPeriodInfo().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[out]minThe minimum aggregation period in millis, negative if unknown. It is written on success only.
[out]maxThe maximum aggregation period in millis, negative if unknown. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when min or max is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_getEventTypes()

dxfg_event_clazz_list_t * dxfg_DXEndpoint_getEventTypes ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Returns the event types that the endpoint supports.

The result is the set of the event types supported by the endpoint and by the current version of the dxFeed Graal Native SDK; the event types that the SDK does not know are left out.

Java: DXEndpoint.getEventTypes().

Deprecated
Use dxfg_v4_DXEndpoint_getEventTypes().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
The list of the supported event types (release it with dxfg_CList_EventClazz_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_getFeed()

dxfg_feed_t * dxfg_DXEndpoint_getFeed ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Returns the feed of the endpoint.

The feed is associated with the endpoint: it receives the events from the endpoint's connection. Releasing the handle of the feed does not affect the endpoint.

Java: DXEndpoint.getFeed().

Deprecated
Use dxfg_v4_DXEndpoint_getFeed().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
The feed (release its handle with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_getInstance()

dxfg_endpoint_t * dxfg_DXEndpoint_getInstance ( graal_isolatethread_t * thread)

Returns the default application-wide singleton endpoint with the DXFG_ENDPOINT_ROLE_FEED role, the same one that dxfg_DXFeed_getInstance() uses.

The endpoint is created on the first call and is configured by the properties of the endpoint and the system properties (see dxfg_system_set_property()) as of that moment.

All callers share this endpoint: closing it closes it for everyone in the process.

Java: DXEndpoint.getInstance().

Deprecated
Use dxfg_v4_DXEndpoint_getInstance().
Parameters
[in]threadThe current GraalVM Isolate's thread.
Returns
The endpoint (release its handle with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_getInstance2()

dxfg_endpoint_t * dxfg_DXEndpoint_getInstance2 ( graal_isolatethread_t * thread,
dxfg_endpoint_role_t role )

Creates a new endpoint with the given role on every call, the same as dxfg_DXEndpoint_create2().

Unlike the Java DXEndpoint.getInstance(Role), this function does not return a singleton: the SDK calls DXEndpoint.create(Role). Prefer dxfg_DXEndpoint_newBuilder() (or dxfg_DXEndpoint_create2()) in the new code.

Java: DXEndpoint.create(DXEndpoint.Role).

Deprecated
Use dxfg_v4_DXEndpoint_createWithRole().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]roleThe role of the endpoint.
Returns
The new endpoint, or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception. The caller owns the endpoint: close it with dxfg_DXEndpoint_close() or dxfg_DXEndpoint_closeAndAwaitTermination() and free its handle with dxfg_JavaObjectHandler_release().

◆ dxfg_DXEndpoint_getPublisher()

dxfg_publisher_t * dxfg_DXEndpoint_getPublisher ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Returns the publisher of the endpoint.

The publisher is associated with the endpoint: it publishes the events to the endpoint's connection. Releasing the handle of the publisher does not affect the endpoint.

Java: DXEndpoint.getPublisher().

Deprecated
Use dxfg_v4_DXEndpoint_getPublisher().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
The publisher (release its handle with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_getRequestedAggregationPeriod()

int32_t dxfg_DXEndpoint_getRequestedAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
DXFG_OUT dxfg_time_period_t ** period )

Returns the aggregation period that the endpoint requests from the server.

Java: DXEndpoint.getRequestedAggregationPeriod().

Deprecated
Use dxfg_v4_DXEndpoint_getRequestedAggregationPeriod().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[out]periodThe requested aggregation period (release the handle with dxfg_JavaObjectHandler_release()), or NULL if no period is requested. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when period is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_getRequestedAggregationPeriodMillis()

int32_t dxfg_DXEndpoint_getRequestedAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
DXFG_OUT int64_t * period )

Returns the aggregation period (in millis) that the endpoint requests from the server.

Java: DXEndpoint.getRequestedAggregationPeriod().

Deprecated
Use dxfg_v4_DXEndpoint_getRequestedAggregationPeriodMillis().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[out]periodThe requested aggregation period in millis, or -1 if no period is requested. It is written on success only.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (also when period is NULL). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_getRole()

dxfg_endpoint_role_t dxfg_DXEndpoint_getRole ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Returns the role of the endpoint.

Java: DXEndpoint.getRole().

Deprecated
Use dxfg_v4_DXEndpoint_getRole().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
The role of the endpoint, or -1 on error: it is not a value of dxfg_endpoint_role_t, so compare the result with -1 before using it. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_getState()

dxfg_endpoint_state_t dxfg_DXEndpoint_getState ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Returns the state of the endpoint.

Java: DXEndpoint.getState().

Deprecated
Use dxfg_v4_DXEndpoint_getState().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
Returns
The state of the endpoint, or -1 on error: it is not a value of dxfg_endpoint_state_t, so compare the result with -1 before using it. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_DXEndpoint_password()

int32_t dxfg_DXEndpoint_password ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
const char * password )

Sets the password of the endpoint.

Call it before dxfg_DXEndpoint_connect(), together with dxfg_DXEndpoint_user(), to configure the credentials of a service that requires them. A NULL password is an error.

Java: DXEndpoint.password(String).

Deprecated
Use dxfg_v4_DXEndpoint_password().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]passwordThe password, a NUL-terminated UTF-8 string; the SDK copies it.
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_DXEndpoint_reconnect()

int32_t dxfg_DXEndpoint_reconnect ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint )

Terminates all the network connections of the endpoint and initiates connecting again with the same address.

It works like dxfg_DXEndpoint_disconnect() followed by dxfg_DXEndpoint_connect() with the current address, but the internal resources may be reused. A connection with several target addresses tries to switch to an alternative address; the configured reconnect timeouts apply.

The function does not connect an endpoint that was not connected with dxfg_DXEndpoint_connect() or was disconnected with dxfg_DXEndpoint_disconnect(). Whether a state change listener sees the intermediate DXFG_ENDPOINT_STATE_NOT_CONNECTED state is not specified.

Java: DXEndpoint.reconnect().

Deprecated
Use dxfg_v4_DXEndpoint_reconnect().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
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_DXEndpoint_removeStateChangeListener()

int32_t dxfg_DXEndpoint_removeStateChangeListener ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_endpoint_state_change_listener_t * listener )

Removes the state change listener that was added with dxfg_DXEndpoint_addStateChangeListener().

A notification that is already scheduled may still reach the listener after the function returns: release the listener's handle with dxfg_JavaObjectHandler_release() (or deactivate it with dxfg_NativeListener_deactivate()) to be sure that its function is not called anymore. The function does not release the handle.

Java: DXEndpoint.removeStateChangeListener(PropertyChangeListener).

Deprecated
Use dxfg_v4_DXEndpoint_removeStateChangeListener().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]listenerThe listener to remove. The caller keeps its handle.
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_DXEndpoint_setRequestedAggregationPeriod()

int32_t dxfg_DXEndpoint_setRequestedAggregationPeriod ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
dxfg_time_period_t * period )

Sets the aggregation period that the endpoint requests from the server.

The server keeps the period within its own bounds and reports the period it applies: see dxfg_DXEndpoint_getAggregationPeriodInfo(). The period can also be requested with the dxfeed.requestedAggregationPeriod property or the [requestedAggregationPeriod=5s] address option.

Java: DXEndpoint.setRequestedAggregationPeriod(TimePeriod).

Deprecated
Use dxfg_v4_DXEndpoint_setRequestedAggregationPeriod().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]periodThe requested aggregation period: zero (dxfg_TimePeriod_ZERO()) requests real-time delivery, NULL clears the request (the server uses its default period). It must not exceed 24 hours. The endpoint does not take the handle: release it with dxfg_JavaObjectHandler_release() when it is no longer needed.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (for example, when the period exceeds 24 hours). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_setRequestedAggregationPeriodMillis()

int32_t dxfg_DXEndpoint_setRequestedAggregationPeriodMillis ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
int64_t period )

Sets the aggregation period (in millis) that the endpoint requests from the server.

The same as dxfg_DXEndpoint_setRequestedAggregationPeriod(), without a time period handle.

Java: DXEndpoint.setRequestedAggregationPeriod(TimePeriod), called with TimePeriod.valueOf(long), or with null for a negative period.

Deprecated
Use dxfg_v4_DXEndpoint_setRequestedAggregationPeriodMillis().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]periodThe requested aggregation period in millis: 0 requests real-time delivery, a negative value clears the request (the server uses its default period). It must not exceed 24 hours (86400000).
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error (for example, when the period exceeds 24 hours). Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_DXEndpoint_user()

int32_t dxfg_DXEndpoint_user ( graal_isolatethread_t * thread,
dxfg_endpoint_t * endpoint,
const char * user )

Sets the user name of the endpoint.

Call it before dxfg_DXEndpoint_connect(), together with dxfg_DXEndpoint_password(), to configure the credentials of a service that requires them. A NULL user name is an error.

Java: DXEndpoint.user(String).

Deprecated
Use dxfg_v4_DXEndpoint_user().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]endpointThe endpoint.
[in]userThe user name, a NUL-terminated UTF-8 string; the SDK copies it.
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_PropertyChangeListener_new()

dxfg_endpoint_state_change_listener_t * dxfg_PropertyChangeListener_new ( graal_isolatethread_t * thread,
dxfg_endpoint_state_change_listener_func user_func,
void * user_data )

Creates a new endpoint state change listener.

The listener does nothing until it is added to an endpoint with dxfg_DXEndpoint_addStateChangeListener(). The function is called as described at dxfg_endpoint_state_change_listener_func.

Releasing the last handle of the listener with dxfg_JavaObjectHandler_release() (or dxfg_NativeListener_deactivate()) stops the calls of the function: after the release returns the function is not running and is not called anymore, so the user data can be freed. Remove the listener from the endpoint as well, otherwise it stays added and does nothing.

Java: PropertyChangeListener.propertyChange(PropertyChangeEvent).

Deprecated
Use dxfg_v4_PropertyChangeListener_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]user_funcThe function to call on the state changes (see dxfg_DXEndpoint_addStateChangeListener()).
[in]user_dataThe user data to pass to the function; the SDK does not use it. It must stay valid until the listener is deactivated.
Returns
The listener (release its handle with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.