Commit b1301aee authored by René Schöne's avatar René Schöne
Browse files

WIP: working on correct connect and disconnect

- fixing imports
parent 729568de
Pipeline #10665 failed with stages
in 12 minutes and 32 seconds
import java.util.Set;
import java.util.TreeSet;
import java.util.LinkedList;
aspect Errors {
coll Set<ErrorMessage> RagConnect.errors()
[new TreeSet<ErrorMessage>()]
......
import java.util.*;
aspect Imports {
// empty
}
import java.util.List;
import java.util.ArrayList;
aspect RagConnectNavigation {
// --- program ---
......
......@@ -239,7 +239,7 @@ public class MqttHandler {
private java.util.List<java.util.function.BiConsumer<String, byte[]>> callbacksFor(String topicString) {
java.util.List<java.util.function.BiConsumer<String, byte[]>> result = new java.util.ArrayList<>();
List<BiConsumer<String, byte[]>> normalCallbackList = normalCallbacks.get(topicString);
java.util.List<java.util.function.BiConsumer<String, byte[]>> normalCallbackList = normalCallbacks.get(topicString);
if (normalCallbackList != null) {
result.addAll(normalCallbackList);
}
......@@ -305,7 +305,7 @@ public class MqttHandler {
if (pairToAddTo == null) {
pairToAddTo = new PatternCallbackListPair();
pairToAddTo.pattern = java.util.regex.Pattern.compile(regex);
pairToAddTo.callbacks = new ArrayList<>();
pairToAddTo.callbacks = new java.util.ArrayList<>();
wildcardCallbacks.add(pairToAddTo);
}
needSubscribe = pairToAddTo.callbacks.isEmpty();
......@@ -321,7 +321,7 @@ public class MqttHandler {
}
if (needSubscribe) {
// subscribe at broker
CountDownLatch operationFinished = new CountDownLatch(1);
java.util.concurrent.CountDownLatch operationFinished = new java.util.concurrent.CountDownLatch(1);
java.util.concurrent.atomic.AtomicReference<Boolean> success = new java.util.concurrent.atomic.AtomicReference<>(true);
org.fusesource.mqtt.client.Topic[] topicArray = { new org.fusesource.mqtt.client.Topic(topic, this.qos) };
connection.getDispatchQueue().execute(() -> {
......@@ -341,7 +341,7 @@ public class MqttHandler {
});
});
try {
operationFinished.await(2, TimeUnit.SECONDS);
operationFinished.await(2, java.util.concurrent.TimeUnit.SECONDS);
return success.get();
} catch (InterruptedException e) {
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment