Driver Development Kit (DDK)

AggreGate Server Driver Development Kit (DDK) is a part of AggreGate SDK that allows to implement custom AggreGate Server Device Drivers in Java programming language.

Device Driver Plugins

AggreGate Server Device Driver is a type of AggreGate Server plugin. Technically, the driver has two mandatory components:

  • Driver Java class that implements DeviceDriver interface. Most implementations extend AbstractDeviceDriver class to avoid implementing irrelevant methods and preserve their default functionality.

  • Driver plugin descriptor that defines driver plugin properties and its place in AggreGate Server plugins hierarchy.

Device Server SDK bundle includes an open-source example of AggreGate Server Device Driver implementation called Demo Device Driver. It is located in examples.driver package and comprises three files:

  • DemoDeviceDriver.java - source code of the driver

  • plugin.properties - driver plugin descriptor

  • build.gradle - Gradle build file with a single task building driver's JAR archive

To try the driver:

  • Run build.gradle using Gradle to build demo.jar

  • Copy demo.jar to %AggreGate Server Installation Folder/plugins/device when AggreGate Server is not running

  • Start AggreGate Server

  • Create new Device account and specify Demo Device as driver type

Device Driver Instance Creation

Developers of device drivers should be aware of the policy used by AggreGate Server to create driver objects, i.e. instances of Java class inherited from AbstractDeviceDriver:

  • One instance of driver class is created during server startup. This instance is responsible for plugin's global and per-user initialization/deinitialization. Thus, server calls the following methods of this instance: globalInit(), globalDeinit(), globalStart(), globalStop(). It also calls several methods once per every user account in the system: userInit(), userDeinit().

  • One instance of driver class is created for every device account that uses this type of driver. This instance performs the actual communications with the hardware or data source and interacts with a certain DeviceContext.

  • Also, instances of driver class may be created during the new device creation action (at device connection properties specification stage). The only method that will be called from those instances is createConnectionPropertiesFormat().

Was this page helpful?