Skip to content

Commit 3d7ec93

Browse files
authored
1.0.3
Implement buffer feature, which uses an etsdb database to store updates that failed to send. Upon successfully sending an update, the DSLink will also send any unsent updates that are in the buffer. The buffer includes optional auto-purge functionality, which will erase the oldest unsent updates if the buffer exceeds a certain size. In order to more efficiently send the buffered updates, the rule format now includes %STARTBLOCK% and %ENDBLOCK% as delimeters for a repeatable block in a "batch update" request.
2 parents 590a341 + be09376 commit 3d7ec93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5706
-57
lines changed

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ repositories {
2424

2525
dependencies {
2626
//implementation 'org.iot-dsa:dslink-v2-websocket:+' //for a locally installed sdk
27-
implementation 'com.github.iot-dsa-v2.sdk-dslink-java-v2:dslink-v2-websocket:+'
27+
implementation 'com.github.iot-dsa-v2.sdk-dslink-java-v2:dslink-v2-websocket:v+'
2828
implementation 'commons-logging:commons-logging:+'
2929
implementation 'org.apache.commons:commons-lang3:3.6'
30+
implementation 'commons-io:commons-io:2.6'
3031
implementation 'org.apache.cxf:cxf-rt-rs-security-oauth2:3.1.7'
3132
implementation 'org.apache.cxf:cxf-rt-rs-client:3.0.0-milestone1'
3233
implementation 'javax.xml.bind:jaxb-api:2.3.0'
3334
implementation 'javax.activation:activation:+'
3435

36+
testImplementation 'junit:junit:+'
37+
testImplementation 'org.mockito:mockito-all:+'
38+
3539
}
3640

3741
applicationDistribution.from(new File(project.projectDir, "/dslink.json"))

docs/Usage_Guide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Once you have a connection, you can set up a rule using the `Add Rule` action. T
1515
- Method: The REST method to use.
1616
- URL Parameters: A map of URL parameters to use when sending the REST request. If you want to use the value, timestamp, or status of an update in the params, use the placeholders `%VALUE%`, `%TIMESTAMP%` and `%STATUS%`.
1717
- Body: The body of the REST request, if applicable. Once again, use `%VALUE%`, `%TIMESTAMP%` and `%STATUS%` as placeholders.
18+
- Note: If the REST API supports recieving multiple updates in one message, you can use `%STARTBLOCK%` and `%ENDBLOCK%` to denote the boundaries of a repeatable block. When needing to send many updates at once (in the case of having to catch up after a disconnect), the DSLink will repeat the block for each update and use commas to separate the blocks. Note that this will only work if all value, timestamp, and status placeholders are in the body and inside the repeatable block.
1819
- Minimum Refresh Rate: Optional, ensures that at least this many seconds elapse between updates. This means that the DSLink will suppress updates that are too close together. (Leave this parameter as 0 to not use this feature.)
1920
- Maximum Refresh Rate: Optional, ensures that an update gets sent every this many seconds. This means that if the DSA value updates too infrequently, the DSLink will send duplicate updates. (Leave this parameter as 0 to not use this feature.)
2021
## Add a Rule Table
@@ -40,10 +41,12 @@ If you want to set up multiple rules in bulk, create a table of Rules in Atrius
4041
},
4142
"data": {
4243
"<BuildingOS meter id>": [
44+
%STARTBLOCK%
4345
[
4446
"%TIMESTAMP%",
4547
%VALUE%
4648
]
49+
%ENDBLOCK%
4750
]
4851
}
4952
}
@@ -56,10 +59,12 @@ e.g:
5659
},
5760
"data": {
5861
"b9c7c0a03de611e895505254009e602c": [
62+
%STARTBLOCK%
5963
[
6064
"%TIMESTAMP%",
6165
%VALUE%
6266
]
67+
%ENDBLOCK%
6368
]
6469
}
6570
}

dslink.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dslink-java-v2-restadapter",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Java DSA to REST adpater DSLink",
55
"main": "bin/dslink-java-v2-restadapter",
66
"configs": {

0 commit comments

Comments
 (0)