Service
The Service class is the main class in the API. It establishes a connection with Data Refinery and exposes methods for pulling data from, and pushing data to, Data Refinery.
The library's core functionality and components are accessed through the IDeltaService interface, implemented by the DefaultDeltaService type, which is part of the DeltaApiCore library.
The interface includes the Start method that will start each configured component appropriately.
Note
The three underlying core components listed below are not visible outside of the_ DaaSJavaApiCore _code, and therefore not visible to the Client API user/code. This is for background information only.
DefaultDeltaService contains a default implementation for all core components.
The underlying core components include:
- DeltaControlPrclConnection : Core connectivity to Delta Control.
- IDeltaAPIService : Managed calling of public analytics.
- IStreamingAnalyticsService : For receiving data from streaming analytics.
- DeltaMessagingServer: For publishing data.
Access has been limited to using the following methods on the Service class:
- start : Start the Data Refinery service.
- runQuery : Run a Data Refinery query.
- startMessagingServer : Starts the messaging server
- registerPublisher : Register a publisher with Data Refinery.
- unregisterPublisher : Unregister a publisher with Data Refiner.
The constructor for the Service class requires the following parameters:
| Parameter | Description |
|---|---|
| Primary Host Name | The hostname of the primary /A-side/Prod Delta Control instance. |
| Primary Port | The port of the primary /A-side/Prod Delta Control instance. |
| Secondary Host Name (optional) | The host name of the secondary /B-side/DR/backup Delta Control instance to try if the primary is not available. |
| Secondary Port (optional) | The port of the secondary /B-side/DR/backup Delta Control |
| Username | Administrator : This is the service account to be used by the Client API. These access details will be supplied by the Administrator |
| Password | Administrator : This is the service account to be used by the Client API. These access details will be supplied by the Administrator |
| Instance Name | This is defined by the user and will be the name of the proxy process used inside Delta Control to represent the API connection.Format: Any alphanumeric characters plus underscore |
| Exclusive Process | Determines whether duplicate instances of this process can exist simultaneously.Should normally be set to true to ensure only one instance of the application can connect to Delta Control. |
| TLS Connection | Set true to enable login string encryption. |
These parameters can be passed in via an external config file. More details in Section 5.7
public void loadSettings() throws IOException
{
Properties properties = new Properties();
properties.load(ServiceTest.class.getClassLoader().getResourceAsStream("./connection.properties"));
primaryHost = properties.getProperty("primary-host");
primaryPort = Integer.valueOf(properties.getProperty("primary-port"));
secondaryHost = properties.getProperty("secondary-host");
secPort = properties.getProperty("secondary-port");
secondaryPort = Integer.valueOf(StringUtils.isEmpty(secPort) ? "0" : secPort);
messagingServerConfigName = properties.getProperty("messaging-server-config-name");
username = properties.getProperty("username");
password = properties.getProperty("password");
instanceName = properties.getProperty("instanceName");
exclusive = Boolean.parseBoolean(properties.getProperty("exclusive"));
encrypted = Boolean.parseBoolean(properties.getProperty("encrypted"));}
The /src/test/java/com/fd/daas/api folder (test folder) contains additional examples of using the Service class.