aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/AsyncSocket.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/api/AsyncSocket.java b/src/org/traccar/api/AsyncSocket.java
index 76ec99406..d1e5594f4 100644
--- a/src/org/traccar/api/AsyncSocket.java
+++ b/src/org/traccar/api/AsyncSocket.java
@@ -47,7 +47,7 @@ public class AsyncSocket extends WebSocketAdapter implements ConnectionManager.U
public void onWebSocketConnect(Session session) {
super.onWebSocketConnect(session);
- Map<String, Collection<?>> data = new HashMap<String, Collection<?>>();
+ Map<String, Collection<?>> data = new HashMap<>();
data.put(KEY_POSITIONS, Context.getConnectionManager().getInitialState(userId));
sendData(data);
@@ -63,21 +63,21 @@ public class AsyncSocket extends WebSocketAdapter implements ConnectionManager.U
@Override
public void onUpdateDevice(Device device) {
- Map<String, Collection<?>> data = new HashMap<String, Collection<?>>();
+ Map<String, Collection<?>> data = new HashMap<>();
data.put(KEY_DEVICES, Collections.singletonList(device));
sendData(data);
}
@Override
public void onUpdatePosition(Position position) {
- Map<String, Collection<?>> data = new HashMap<String, Collection<?>>();
+ Map<String, Collection<?>> data = new HashMap<>();
data.put(KEY_POSITIONS, Collections.singletonList(position));
sendData(data);
}
@Override
public void onUpdateEvent(Event event, Position position) {
- Map<String, Collection<?>> data = new HashMap<String, Collection<?>>();
+ Map<String, Collection<?>> data = new HashMap<>();
data.put(KEY_EVENTS, Collections.singletonList(event));
if (position != null) {
data.put(KEY_POSITIONS, Collections.singletonList(position));