Class DXEndpoint.Builder
Builder class for DXEndpoint that supports additional configuration properties.
Porting a Java class com.dxfeed.api.DXEndpoint.Builder
.
For more details see Javadoc.
Default properties file
The Build() method tries to load the default property file for the Feed,
OnDemandFeed and Publisher role.
The default properties file is loaded only if there are no system properties (SystemProperty)
or user properties (WithProperty(string, string)) set with the same key
(DXFeedPropertiesProperty, DXPublisherPropertiesProperty)
and the file exists and is readable.
This file must be in the Java properties file format.
Endpoint name
If no endpoint name has been specified (WithName(string)), the default name will be used. The default name includes a counter that increments each time an endpoint is created ("qdnet", "qdnet-1", etc.). To get the name of the created endpoint, call the GetName() method.
Threads and locks
This class is thread-safe and can be used concurrently from multiple threads without external synchronization.
public class DXEndpoint.Builder
- Inheritance
-
DXEndpoint.Builder
- Inherited Members
Methods
Build()
Builds DXEndpoint instance. This method tries to load default properties file.
public DXEndpoint Build()
Returns
- DXEndpoint
The created DXEndpoint.
Exceptions
- JavaException
If the error occurred on the java side.
SupportsProperty(string)
Checks if the corresponding property key is supported.
public bool SupportsProperty(string key)
Parameters
key
stringThe name of the property.
Returns
- bool
Returns
true
if the corresponding property key is supported; otherwise,false
.
Exceptions
- ArgumentNullException
If the key is null.
WithName(string)
Changes name that is used to distinguish multiple DXEndpoint in the same in logs and in other diagnostic means. This is a shortcut for WithProperty(DXEndpoint.NameProperty, name).
public DXEndpoint.Builder WithName(string name)
Parameters
name
stringThe endpoint name.
Returns
- DXEndpoint.Builder
Returns this DXEndpoint.Builder.
Exceptions
- ArgumentNullException
If the name is null.
WithProperties(IReadOnlyDictionary<string, string>)
Sets the specified properties from the provided key-value collection. Unsupported properties are ignored.
public DXEndpoint.Builder WithProperties(IReadOnlyDictionary<string, string> properties)
Parameters
properties
IReadOnlyDictionary<string, string>The key-value collection.
Returns
- DXEndpoint.Builder
Returns this DXEndpoint.Builder.
Exceptions
- ArgumentNullException
If key or value inside the properties is null.
WithProperty(KeyValuePair<string, string>)
Sets the specified property. Unsupported properties are ignored.
public DXEndpoint.Builder WithProperty(KeyValuePair<string, string> kvp)
Parameters
kvp
KeyValuePair<string, string>The key-value pair.
Returns
- DXEndpoint.Builder
Returns this DXEndpoint.Builder.
Exceptions
- ArgumentNullException
If key or value is null.
WithProperty(string, string)
Sets the specified property. Unsupported properties are ignored.
public DXEndpoint.Builder WithProperty(string key, string value)
Parameters
Returns
- DXEndpoint.Builder
Returns this DXEndpoint.Builder.
Exceptions
- ArgumentNullException
If key or value is null.
WithRole(Role)
Sets role for the created DXEndpoint. Default role is Feed.
public DXEndpoint.Builder WithRole(DXEndpoint.Role role)
Parameters
role
DXEndpoint.RoleThe endpoint role.
Returns
- DXEndpoint.Builder
Returns this DXEndpoint.Builder.
Exceptions
- ArgumentException
If the role does not exist.