Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/cz/smarteon/loxone/Loxone.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
Expand Down Expand Up @@ -48,7 +48,7 @@ public class Loxone {
private final LoxoneWebSocket loxoneWebSocket;
private final LoxoneAuth loxoneAuth;

private final List<LoxoneAppListener> loxoneAppListeners = new LinkedList<>();
private final List<LoxoneAppListener> loxoneAppListeners = new CopyOnWriteArrayList<>();
private final LoxoneWebSocketListener webSocketListener = this::start;
private final Map<LoxoneEndpoint, LoxoneHttp> clientMiniserversHttp = new HashMap<>();

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cz/smarteon/loxone/LoxoneAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import javax.crypto.SecretKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -103,7 +103,7 @@ public LoxoneAuth(@NotNull LoxoneHttp loxoneHttp, @NotNull LoxoneProfile profile
this.getKeyCommand = getKey(profile.getUsername());
this.getVisuHashCommand = LoxoneMessageCommand.getVisuHash(profile.getUsername());

this.authListeners = new LinkedList<>();
this.authListeners = new CopyOnWriteArrayList<>();
}

@Deprecated
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/cz/smarteon/loxone/LoxoneWebSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
Expand Down Expand Up @@ -89,9 +89,9 @@ public LoxoneWebSocket(final @NotNull LoxoneEndpoint endpoint, final @NotNull Lo
this.webSocketClientProvider = requireNonNull(webSocketClientProvider,
"webSocketClientProvider shouldn't be null");

this.webSocketListeners = new HashSet<>();
this.commandResponseListeners = new LinkedList<>();
this.eventListeners = new LinkedList<>();
this.webSocketListeners = new CopyOnWriteArraySet<>();
this.commandResponseListeners = new CopyOnWriteArrayList<>();
this.eventListeners = new CopyOnWriteArrayList<>();
this.commands = new ConcurrentLinkedQueue<>();

// link loxoneAuth as command listener
Expand Down