HTTP Digital Adapter
The HttpDigitalAdapter
is a powerful component designed to facilitate the integration of Digital Twins into HTTP-based systems.
+Change Logs
diff --git a/blog/index.html b/blog/index.html index c383680..c68d672 100644 --- a/blog/index.html +++ b/blog/index.html @@ -1,7 +1,7 @@
-August 29, 2024 ‐ 1 min read
March 13, 2024 ‐ 3 min read
March 13, 2024 ‐ 3 min read
📣 We’re thrilled to announce the release of version 0.3.0 of the White Label Digital Twins (WLDT) library! +
March 13, 2024 ‐ 3 min read
📣 We’re thrilled to announce the release of version 0.3.0 of the White Label Digital Twins (WLDT) library! This release brings significant enhancements, improvements, and new features to further empower developers in designing, developing, and deploying Digital Twins within Internet of Things (IoT) ecosystems.
For detailed information about these changes and their impact, please refer to the information provided:
Let’s dive into the key changes and updates included in this release:
In version 0.3.0, we’ve made several enhancements and adjustments to the Digital Adapter class to improve its functionality and usability. Notable changes include:
We’ve made significant improvements to the ShadowingModelFunction, which is now renamed to ShadowingFunction. Additionally, we’ve introduced changes to how the DigitalTwinState is managed within the Shadowing Function, providing developers with more control and flexibility.
In version 0.3.0, the WldtEngine class has been renamed to DigitalTwin, offering improved clarity and consistency. We’ve also made adjustments to the lifecycle management of Digital Twins, streamlining the process and enhancing usability.
We’ve introduced enhancements to the Digital Twin and Digital Twin Engine classes, providing developers with improved functionality and ease of use. Notable updates include:
The DigitalTwinStateManager class has been improved to provide better support for managing the state of Digital Twins. With features such as transaction support and event notification, developers can more effectively manage changes to Digital Twin states and respond to events.
To learn more about the capabilities of the DigitalTwinStateManager, please refer to the Digital Twin State Manager section.
We’ve extended and improved the Digital Adapter base class to provide enhanced support for handling Digital Twin state updates and event notifications. With the introduction of the onStateUpdate and onEventNotificationReceived methods, developers can more effectively respond to changes in Digital Twin states and events.
To get started with version 0.3.0 of the WLDT library, simply update your dependencies to include the latest release. Detailed documentation and usage examples are available in the project repository, providing comprehensive guidance on leveraging the new features and enhancements.
We’re excited about the improvements and new capabilities introduced in WLDT 0.3.0, and we can’t wait to see how developers utilize them to create innovative IoT solutions powered by Digital Twins. As always, we welcome your feedback and contributions to help us further improve the library and empower the community.
Happy coding with WLDT 0.3.0! 🚀
August 29, 2024 ‐ 1 min read
We’re excited to announce the release of WLDT version 0.4.0! This update brings powerful new features to enhance your Digital Twin (DT) experience, including event observation capabilities, a robust storage layer, and a flexible query system.
For detailed information about these changes and their impact, please refer to the information provided:
Storage Manager
: Manage and use various storage systems (e.g., in-memory, file-based, DBMS) simultaneously.WldtStorage
: An abstract class to implement custom storage systems. The default in-memory storage is available for development and testing.Query System
: The query system enables external components like Digital Adapters to retrieve stored data efficiently, supporting both synchronous and asynchronous queries.WLDT 0.4.0 significantly enhances the flexibility and capabilities of Digital Twins, making it easier to manage and retrieve data, and observe events. We encourage developers to explore these new features and integrate them into their projects.
Stay tuned for more updates!
The HttpDigitalAdapter
is a powerful component designed to facilitate the integration of Digital Twins into HTTP-based systems.
+Change Logs
The HttpDigitalAdapter
is a powerful component designed to facilitate the integration of Digital Twins into HTTP-based systems.
It serves as a bridge between a Digital Twin and HTTP-based applications, allowing developers to easily expose and interact with
-Digital Twin data and functionalities over HTTP.
Key Features:
A complete example is provided in the test
folder with a complete DT Creation in the TestMain
class together with a demo DT with and emulated Physical Adapter and the HTTP Digital Adapter.
The correct mapping and compatibility between versions is reported in the following table
http-digital-adapter | wldt-core 0.2.1 | wldt-core 0.3.0 |
---|---|---|
0.1.1 | ❌ | ✅ |
To use HttpDigitalAdapter in your Java project, you can include it as a dependency using Maven or Gradle.
<dependency>
+Digital Twin data and functionalities over HTTP.Key Features:
- HTTP Integration: Seamlessly integrates Digital Twins into HTTP environments, enabling communication with web applications and services.
- Dynamic Configuration: Offers a flexible configuration mechanism through the HttpDigitalAdapterConfiguration, allowing developers to customize the adapter’s behavior based on specific requirements.
- State Monitoring: Monitors changes in the Digital Twin state and provides HTTP endpoints to query the state of the Digital Twin (properties, events, actions and relationships).
- Event Notifications: Allows developers to retrieve event notifications triggered by changes in the Digital Twin state.
- Storage & Query: Since version 0.2 the HTTP Digital Adapter is able to retrieve Storage Statistics and execute query on the target DT
A complete example is provided in the test
folder with a complete DT Creation in the TestMain
class together with a demo DT with and emulated Physical Adapter and the HTTP Digital Adapter.
WLDT-Core Version Compatibility
The correct mapping and compatibility between versions is reported in the following table
http-digital-adapter wldt-core 0.2.1 wldt-core 0.3.0 wldt-core 0.4.0 0.1.1 ❌ ✅ ✅ 0.2 ❌ ❌ ✅
Installation
To use HttpDigitalAdapter in your Java project, you can include it as a dependency using Maven or Gradle.
Maven
<dependency>
<groupId>io.github.wldt</groupId>
<artifactId>http-digital-adapter</artifactId>
- <version>0.1.1</version>
+ <version>0.2</version>
</dependency>
-
Gradle
implementation 'io.github.wldt:http-digital-adapter:0.1.1'
+
Gradle
implementation 'io.github.wldt:http-digital-adapter:0.2'
Class Structure & Functionalities
HttpDigitalAdapterConfiguration
The HttpDigitalAdapterConfiguration
is a crucial part of the HttpDigitalAdapter, providing the necessary settings to
tailor the adapter’s behavior to meet specific needs.
Represents the configuration for an HTTP Digital Adapter, specifying the host, port,
and filters for properties, actions, events, and relationships.
The filters are used to selectively include or exclude specific properties, actions,
@@ -66,6 +66,66 @@
digitalTwinEngine.startAll();
This section of the documentation provides detailed information about the RESTful API exposed by the WLDT - HTTP Digital Adapter. The API allows you to interact with the Digital Twin (DT) instance, retrieve its state, read properties, actions, event and relationships description, -and trigger actions.
Available endpoints with the associated methods are:
GET
/instance
: Retrieves information about the Digital Twin instance.GET
/state
: Retrieves the current state of the Digital Twin.GET
/state/changes
: Retrieves the list of state changes in the Digital Twin.GET
/state/previous
: Retrieves the previous state of the Digital Twin.GET
/state/properties
: Retrieves the list of properties in the Digital Twin state.GET
/properties/{propertyKey}
: Retrieves the value of a specific property (e.g., /properties/color) from the Digital Twin state.GET
/state/events
: Retrieves the list of events in the Digital Twin state.GET
/state/actions
: Retrieves the list of actions in the Digital Twin state.POST
/state/actions/{actionKey}
: Triggers the specified action (e.g., /state/actions/switch_on) in the Digital Twin state. The raw body contains the action request payload.GET
/state/relationships
: Retrieves the list of relationships in the Digital Twin state.GET
/state/relationships/{relationshipName}/instances
: Retrieves the instances of the specified relationship (e.g., /state/relationships/insideIn/instances) in the Digital Twin state.Note: Replace {propertyKey}, {actionKey}, and {relationshipName} with the actual values you want to retrieve or trigger.
-Make sure to use the appropriate HTTP method (GET, POST) and include any required parameters or payload as described in each endpoint’s description. For more detailed information, refer to the Postman Collection for this API available in the folder api
: http_adapter_api_postman.json
Available endpoints with the associated methods are:
GET
/instance
: Retrieves information about the Digital Twin instance.GET
/state
: Retrieves the current state of the Digital Twin.GET
/state/changes
: Retrieves the list of state changes in the Digital Twin.GET
/state/previous
: Retrieves the previous state of the Digital Twin.GET
/state/properties
: Retrieves the list of properties in the Digital Twin state.GET
/properties/{propertyKey}
: Retrieves the value of a specific property (e.g., /properties/color) from the Digital Twin state.GET
/state/events
: Retrieves the list of events in the Digital Twin state.GET
/state/actions
: Retrieves the list of actions in the Digital Twin state.POST
/state/actions/{actionKey}
: Triggers the specified action (e.g., /state/actions/switch_on) in the Digital Twin state. The raw body contains the action request payload.GET
/state/relationships
: Retrieves the list of relationships in the Digital Twin state.GET
/state/relationships/{relationshipName}/instances
: Retrieves the instances of the specified relationship (e.g., /state/relationships/insideIn/instances) in the Digital Twin state.GET
/storage
: Retrieves Storage Statistics from the target Digital TwinPOST
/storage/query
: Allows the execution of a query, where the query structure is specified through a JSON Message in the request Body. For additional information about the Query System see Query System PageNote: Replace {propertyKey}, {actionKey}, and {relationshipName} with the actual values you want to retrieve or trigger.
+Make sure to use the appropriate HTTP method (GET, POST) and include any required parameters or payload as described in each endpoint’s description. For more detailed information, refer to the Postman Collection for this API available in the folder api
: http_adapter_api_postman.json
Example of Storage Query Requests are the following:
Retrieve the first 4 Digital Twin State Variations
{
+ "resourceType": "DIGITAL_TWIN_STATE",
+ "queryType": "SAMPLE_RANGE",
+ "startIndex": 0,
+ "endIndex": 3
+}
+
Retrieve Digital Twin State Variations in a Time Range
{
+ "resourceType": "DIGITAL_TWIN_STATE",
+ "queryType": "TIME_RANGE",
+ "startIndex": 161989898,
+ "endIndex": 162989898
+}
+
Retrieve the last Digital Twin State
{
+ "resourceType": "DIGITAL_TWIN_STATE",
+ "queryType": "LAST_VALUE"
+}
+
Available keywords for Query Resource Type and Query Type are the following (as explained in the dedicated Query System Page):
- PHYSICAL_ASSET_PROPERTY_VARIATION
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- PHYSICAL_ASSET_EVENT_NOTIFICATION
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- PHYSICAL_ACTION_REQUEST
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- DIGITAL_ACTION_REQUEST
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- DIGITAL_TWIN_STATE
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+ - LAST_VALUE
+- NEW_PAD_NOTIFICATION
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- UPDATED_PAD_NOTIFICATION
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- PHYSICAL_RELATIONSHIP_INSTANCE_CREATED_NOTIFICATION
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- PHYSICAL_RELATIONSHIP_INSTANCE_DELETED_NOTIFICATION
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+- LIFE_CYCLE_EVENT
+ - TIME_RANGE
+ - SAMPLE_RANGE
+ - COUNT
+ - LAST_VALUE
+- STORAGE_STATS
+ - LAST_VALUE
+