aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/AsyncSocket.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-06-02 17:11:18 +0500
committerAbyss777 <abyss@fox5.ru>2016-06-02 17:11:18 +0500
commit0271fa29703f24df24756c117209b9b04e127fc3 (patch)
tree7d2afe2b865dc5f9f10faa5ce7d213a219afa82a /src/org/traccar/api/AsyncSocket.java
parentd9e57775e5bb10e722d0043186308df05eea3296 (diff)
downloadtrackermap-server-0271fa29703f24df24756c117209b9b04e127fc3.tar.gz
trackermap-server-0271fa29703f24df24756c117209b9b04e127fc3.tar.bz2
trackermap-server-0271fa29703f24df24756c117209b9b04e127fc3.zip
Style fixes and optimization.
Diffstat (limited to 'src/org/traccar/api/AsyncSocket.java')
-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));