aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <atananaev@lyft.com>2020-12-30 11:18:41 -0800
committerAnton Tananaev <atananaev@lyft.com>2020-12-30 11:18:41 -0800
commit5d0bacea7ebdd169d55c7da0f7d6f3ae1ecf372f (patch)
tree1232cb272eb7163b214de692d0570601fbe435b4 /src/main/java
parentb7677cbcc610c775ba57fa82486e88f42a30d5bd (diff)
downloadtrackermap-server-5d0bacea7ebdd169d55c7da0f7d6f3ae1ecf372f.tar.gz
trackermap-server-5d0bacea7ebdd169d55c7da0f7d6f3ae1ecf372f.tar.bz2
trackermap-server-5d0bacea7ebdd169d55c7da0f7d6f3ae1ecf372f.zip
Add lookup context classes
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/config/Keys.java6
-rw-r--r--src/main/java/org/traccar/config/LookupContext.java51
2 files changed, 54 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java
index 52f1894cd..5f8b36c6d 100644
--- a/src/main/java/org/traccar/config/Keys.java
+++ b/src/main/java/org/traccar/config/Keys.java
@@ -19,6 +19,9 @@ import java.util.Collections;
public final class Keys {
+ private Keys() {
+ }
+
/**
* Network interface for a the protocol. If not specified, server will bind all interfaces.
*/
@@ -1204,7 +1207,4 @@ public final class Keys {
Collections.singletonList(KeyType.GLOBAL),
"time,position,speed,course,accuracy,result");
- private Keys() {
- }
-
}
diff --git a/src/main/java/org/traccar/config/LookupContext.java b/src/main/java/org/traccar/config/LookupContext.java
new file mode 100644
index 000000000..e73e5a35e
--- /dev/null
+++ b/src/main/java/org/traccar/config/LookupContext.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.traccar.config;
+
+public interface LookupContext {
+
+ class Global implements LookupContext {
+ }
+
+ class User implements LookupContext {
+
+ private final long userId;
+
+ public long getUserId() {
+ return userId;
+ }
+
+ public User(long userId) {
+ this.userId = userId;
+ }
+
+ }
+
+ class Device implements LookupContext {
+
+ private final long deviceId;
+
+ public long getDeviceId() {
+ return deviceId;
+ }
+
+ public Device(long deviceId) {
+ this.deviceId = deviceId;
+ }
+
+ }
+
+}