aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/reports
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-02-13 23:34:25 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2022-02-13 23:34:25 -0800
commit1c73bae2e23242673e0a07cdbc2493700f134ceb (patch)
treed1105368628b5f64fabb657682df58f1641e4d54 /src/main/java/org/traccar/reports
parentde110b28ce8adb6ba875d88ede6e8f86dae4dd48 (diff)
downloadtrackermap-server-1c73bae2e23242673e0a07cdbc2493700f134ceb.tar.gz
trackermap-server-1c73bae2e23242673e0a07cdbc2493700f134ceb.tar.bz2
trackermap-server-1c73bae2e23242673e0a07cdbc2493700f134ceb.zip
New storage implementation
Diffstat (limited to 'src/main/java/org/traccar/reports')
-rw-r--r--src/main/java/org/traccar/reports/Events.java6
-rw-r--r--src/main/java/org/traccar/reports/Route.java6
-rw-r--r--src/main/java/org/traccar/reports/Stops.java8
-rw-r--r--src/main/java/org/traccar/reports/Summary.java8
-rw-r--r--src/main/java/org/traccar/reports/Trips.java8
5 files changed, 18 insertions, 18 deletions
diff --git a/src/main/java/org/traccar/reports/Events.java b/src/main/java/org/traccar/reports/Events.java
index 66d9e708d..e4b905702 100644
--- a/src/main/java/org/traccar/reports/Events.java
+++ b/src/main/java/org/traccar/reports/Events.java
@@ -20,7 +20,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -35,6 +34,7 @@ import org.traccar.model.Geofence;
import org.traccar.model.Group;
import org.traccar.model.Maintenance;
import org.traccar.reports.model.DeviceReport;
+import org.traccar.storage.StorageException;
public final class Events {
@@ -42,7 +42,7 @@ public final class Events {
}
public static Collection<Event> getObjects(long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Collection<String> types, Date from, Date to) throws SQLException {
+ Collection<String> types, Date from, Date to) throws StorageException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<Event> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
@@ -66,7 +66,7 @@ public final class Events {
public static void getExcel(OutputStream outputStream,
long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Collection<String> types, Date from, Date to) throws SQLException, IOException {
+ Collection<String> types, Date from, Date to) throws StorageException, IOException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<DeviceReport> devicesEvents = new ArrayList<>();
ArrayList<String> sheetNames = new ArrayList<>();
diff --git a/src/main/java/org/traccar/reports/Route.java b/src/main/java/org/traccar/reports/Route.java
index 6adb00aae..4a5edd295 100644
--- a/src/main/java/org/traccar/reports/Route.java
+++ b/src/main/java/org/traccar/reports/Route.java
@@ -20,7 +20,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -31,6 +30,7 @@ import org.traccar.model.Device;
import org.traccar.model.Group;
import org.traccar.model.Position;
import org.traccar.reports.model.DeviceReport;
+import org.traccar.storage.StorageException;
public final class Route {
@@ -38,7 +38,7 @@ public final class Route {
}
public static Collection<Position> getObjects(long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to) throws SQLException {
+ Date from, Date to) throws StorageException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<Position> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
@@ -50,7 +50,7 @@ public final class Route {
public static void getExcel(OutputStream outputStream,
long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to) throws SQLException, IOException {
+ Date from, Date to) throws StorageException, IOException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<DeviceReport> devicesRoutes = new ArrayList<>();
ArrayList<String> sheetNames = new ArrayList<>();
diff --git a/src/main/java/org/traccar/reports/Stops.java b/src/main/java/org/traccar/reports/Stops.java
index 2036b0641..36a4a7549 100644
--- a/src/main/java/org/traccar/reports/Stops.java
+++ b/src/main/java/org/traccar/reports/Stops.java
@@ -21,7 +21,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -35,13 +34,14 @@ import org.traccar.model.Device;
import org.traccar.model.Group;
import org.traccar.reports.model.DeviceReport;
import org.traccar.reports.model.StopReport;
+import org.traccar.storage.StorageException;
public final class Stops {
private Stops() {
}
- private static Collection<StopReport> detectStops(long deviceId, Date from, Date to) throws SQLException {
+ private static Collection<StopReport> detectStops(long deviceId, Date from, Date to) throws StorageException {
boolean ignoreOdometer = Context.getDeviceManager()
.lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, false, true);
@@ -55,7 +55,7 @@ public final class Stops {
public static Collection<StopReport> getObjects(
long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to) throws SQLException {
+ Date from, Date to) throws StorageException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<StopReport> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
@@ -67,7 +67,7 @@ public final class Stops {
public static void getExcel(
OutputStream outputStream, long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to) throws SQLException, IOException {
+ Date from, Date to) throws StorageException, IOException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<DeviceReport> devicesStops = new ArrayList<>();
ArrayList<String> sheetNames = new ArrayList<>();
diff --git a/src/main/java/org/traccar/reports/Summary.java b/src/main/java/org/traccar/reports/Summary.java
index d576ac1e6..4924af062 100644
--- a/src/main/java/org/traccar/reports/Summary.java
+++ b/src/main/java/org/traccar/reports/Summary.java
@@ -20,7 +20,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
@@ -31,6 +30,7 @@ import org.traccar.Context;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
import org.traccar.reports.model.SummaryReport;
+import org.traccar.storage.StorageException;
public final class Summary {
@@ -97,7 +97,7 @@ public final class Summary {
}
private static Collection<SummaryReport> calculateSummaryResults(
- long userId, long deviceId, Date from, Date to, boolean daily) throws SQLException {
+ long userId, long deviceId, Date from, Date to, boolean daily) throws StorageException {
ArrayList<Position> positions = new ArrayList<>(Context.getDataManager().getPositions(deviceId, from, to));
@@ -122,7 +122,7 @@ public final class Summary {
}
public static Collection<SummaryReport> getObjects(long userId, Collection<Long> deviceIds,
- Collection<Long> groupIds, Date from, Date to, boolean daily) throws SQLException {
+ Collection<Long> groupIds, Date from, Date to, boolean daily) throws StorageException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<SummaryReport> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
@@ -134,7 +134,7 @@ public final class Summary {
public static void getExcel(OutputStream outputStream,
long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to, boolean daily) throws SQLException, IOException {
+ Date from, Date to, boolean daily) throws StorageException, IOException {
ReportUtils.checkPeriodLimit(from, to);
Collection<SummaryReport> summaries = getObjects(userId, deviceIds, groupIds, from, to, daily);
String templatePath = Context.getConfig().getString("report.templatesPath",
diff --git a/src/main/java/org/traccar/reports/Trips.java b/src/main/java/org/traccar/reports/Trips.java
index 7c0cd6921..1461b869e 100644
--- a/src/main/java/org/traccar/reports/Trips.java
+++ b/src/main/java/org/traccar/reports/Trips.java
@@ -20,7 +20,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -34,13 +33,14 @@ import org.traccar.model.Device;
import org.traccar.model.Group;
import org.traccar.reports.model.DeviceReport;
import org.traccar.reports.model.TripReport;
+import org.traccar.storage.StorageException;
public final class Trips {
private Trips() {
}
- private static Collection<TripReport> detectTrips(long deviceId, Date from, Date to) throws SQLException {
+ private static Collection<TripReport> detectTrips(long deviceId, Date from, Date to) throws StorageException {
boolean ignoreOdometer = Context.getDeviceManager()
.lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, false, true);
@@ -53,7 +53,7 @@ public final class Trips {
}
public static Collection<TripReport> getObjects(long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to) throws SQLException {
+ Date from, Date to) throws StorageException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<TripReport> result = new ArrayList<>();
for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) {
@@ -65,7 +65,7 @@ public final class Trips {
public static void getExcel(OutputStream outputStream,
long userId, Collection<Long> deviceIds, Collection<Long> groupIds,
- Date from, Date to) throws SQLException, IOException {
+ Date from, Date to) throws StorageException, IOException {
ReportUtils.checkPeriodLimit(from, to);
ArrayList<DeviceReport> devicesTrips = new ArrayList<>();
ArrayList<String> sheetNames = new ArrayList<>();