Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JastAdd
RagConnect
Commits
abe8a70b
Commit
abe8a70b
authored
Aug 14, 2020
by
René Schöne
Browse files
Update to version 0.2.1
- optimize mqtt-send performance (resolve handler only once)
parent
129dfb46
Pipeline
#7610
passed with stage
in 1 minute and 41 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
new-version.sh
0 → 100755
View file @
abe8a70b
#!/bin/sh
echo
"Old version: '
$(
./gradlew
-q
:ragconnect.base:run
--args
=
--version
)
'"
if
[
-z
"
$1
"
]
;
then
echo
"Missing parameter for version"
exit
1
fi
./gradlew newVersion
-Pvalue
=
$1
ragconnect.base/build.gradle
View file @
abe8a70b
...
...
@@ -61,8 +61,10 @@ jar {
}
from
{
configurations
.
compile
.
collect
{
it
.
isDirectory
()
?
it
:
zipTree
(
it
)
}
configurations
.
runtimeClasspath
.
collect
{
it
.
isDirectory
()
?
it
:
zipTree
(
it
)
}
}
archiveBaseName
=
'ragconnect'
}
task
relast
(
type:
JavaExec
)
{
...
...
ragconnect.base/src/main/resources/MqttHandler.jadd
View file @
abe8a70b
...
...
@@ -53,7 +53,7 @@ public class MqttServerHandler {
resolveHandler(uri).publish(extractTopic(uri), bytes, qos, retain);
}
p
rivate
String extractTopic(java.net.URI uri) {
p
ublic static
String extractTopic(java.net.URI uri) {
String path = uri.getPath();
if (path.charAt(0) == '/') {
path = path.substring(1);
...
...
ragconnect.base/src/main/resources/ragConnectVersion.properties
View file @
abe8a70b
#
Wed Jul 29
1
6
:2
9:05
CEST 2020
version
=
0.2.
0
#
Fri Aug 14
1
3
:2
8:32
CEST 2020
version
=
0.2.
1
ragconnect.base/src/main/resources/sendDefinition.mustache
View file @
abe8a70b
private Runnable
{{
parentTypeName
}}
.
{{
sender
}}
= null;
private byte[]
{{
parentTypeName
}}
.
{{
lastValue
}}
= null;
public boolean
{{
parentTypeName
}}
.
{{
connectMethod
}}
(String
{{
connectParameterName
}}
, boolean writeCurrentValue) {
public boolean
{{
parentTypeName
}}
.
{{
connectMethod
}}
(String
{{
connectParameterName
}}
, boolean writeCurrentValue)
throws java.io.IOException
{
{{>
handleUri
}}
switch (scheme) {
{{#
usesMqtt
}}
case "mqtt":
// MqttHandler handler =
{{
mqttHandlerAttribute
}}
().resolveHandler(uri);
{{!optimize later}}
final MqttHandler handler =
{{
mqttHandlerAttribute
}}
().resolveHandler(uri);
final String topic =
{{
mqttHandlerAttribute
}}
().extractTopic(uri);
{{
sender
}}
= () -> {
{{#
loggingEnabledForWrites
}}
System.out.println("[Send]
{{
tokenName
}}
= " + get
{{
tokenName
}}
() + " -> " +
{{
connectParameterName
}}
);
{{/
loggingEnabledForWrites
}}
try {
{{
mqttHandlerAttribute
}}
().publish(uri,
{{
lastValue
}}
);
} catch (java.io.IOException e) {
e.printStackTrace();
}
handler.publish(topic,
{{
lastValue
}}
);
};
{{
updateMethod
}}
();
if (writeCurrentValue) {
...
...
ragconnect.base/src/main/resources/tokenComponent.mustache
View file @
abe8a70b
...
...
@@ -3,11 +3,9 @@ public {{parentTypeName}} {{parentTypeName}}.set{{name}}({{javaType}} value) {
{{#
DependencyDefinitions
}}
for (
{{
targetParentTypeName
}}
target : get
{{
internalRelationPrefix
}}
TargetList()) {
{{#
targetEndpointDefinition
}}
{{!#isPush}}
if (target.
{{
updateMethod
}}
()) {
target.
{{
writeMethod
}}
();
}
{{!/isPush}}
{{/
targetEndpointDefinition
}}
}
{{/
DependencyDefinitions
}}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment