diff options
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r-- | src/main/java/org/traccar/database/LdapProvider.java | 23 | ||||
-rw-r--r-- | src/main/java/org/traccar/database/StatisticsManager.java | 8 |
2 files changed, 11 insertions, 20 deletions
diff --git a/src/main/java/org/traccar/database/LdapProvider.java b/src/main/java/org/traccar/database/LdapProvider.java index d517294b8..549b68e6c 100644 --- a/src/main/java/org/traccar/database/LdapProvider.java +++ b/src/main/java/org/traccar/database/LdapProvider.java @@ -189,23 +189,12 @@ public class LdapProvider { for (int i = 0; i < input.length(); i++) { char c = input.charAt(i); switch (c) { - case '\\': - sb.append("\\5c"); - break; - case '*': - sb.append("\\2a"); - break; - case '(': - sb.append("\\28"); - break; - case ')': - sb.append("\\29"); - break; - case '\0': - sb.append("\\00"); - break; - default: - sb.append(c); + case '\\' -> sb.append("\\5c"); + case '*' -> sb.append("\\2a"); + case '(' -> sb.append("\\28"); + case ')' -> sb.append("\\29"); + case '\0' -> sb.append("\\00"); + default -> sb.append(c); } } return sb.toString(); diff --git a/src/main/java/org/traccar/database/StatisticsManager.java b/src/main/java/org/traccar/database/StatisticsManager.java index 8711289a0..5f4d97263 100644 --- a/src/main/java/org/traccar/database/StatisticsManager.java +++ b/src/main/java/org/traccar/database/StatisticsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2022 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2024 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,8 +100,6 @@ public class StatisticsManager { statistics.setProtocols(protocols); } - statistics.set("modern", config.getString(Keys.WEB_PATH).contains("modern")); - users.clear(); deviceProtocols.clear(); deviceMessages.clear(); @@ -178,6 +176,10 @@ public class StatisticsManager { } } + public synchronized int messageStoredCount() { + return messagesStored; + } + public synchronized int messageStoredCount(long deviceId) { return deviceMessages.getOrDefault(deviceId, 0); } |