aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/shared/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-16 19:10:15 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-16 19:10:15 +1300
commitfdebc0f3b0453f7898090be98a3edf9664083471 (patch)
treed3dc4143a3d7d722edaa1ea919ed26f597bb9477 /src/org/traccar/web/shared/model
parent92bd56c8bb8a63cf34a19a6197d988ffc671de6c (diff)
downloadtrackermap-web-fdebc0f3b0453f7898090be98a3edf9664083471.tar.gz
trackermap-web-fdebc0f3b0453f7898090be98a3edf9664083471.tar.bz2
trackermap-web-fdebc0f3b0453f7898090be98a3edf9664083471.zip
Created settings classes
Diffstat (limited to 'src/org/traccar/web/shared/model')
-rw-r--r--src/org/traccar/web/shared/model/ApplicationSettings.java28
-rw-r--r--src/org/traccar/web/shared/model/UserSettings.java37
2 files changed, 65 insertions, 0 deletions
diff --git a/src/org/traccar/web/shared/model/ApplicationSettings.java b/src/org/traccar/web/shared/model/ApplicationSettings.java
new file mode 100644
index 00000000..ecbd1832
--- /dev/null
+++ b/src/org/traccar/web/shared/model/ApplicationSettings.java
@@ -0,0 +1,28 @@
+package org.traccar.web.shared.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="application_settings")
+public class ApplicationSettings implements Serializable {
+
+ private static final long serialVersionUID = 1;
+
+ public ApplicationSettings() {
+ registrationEnabled = true;
+ }
+
+ private boolean registrationEnabled;
+
+ public void setRegistrationEnabled(boolean registrationEnabled) {
+ this.registrationEnabled = registrationEnabled;
+ }
+
+ public boolean getRegistrationEnabled() {
+ return registrationEnabled;
+ }
+
+}
diff --git a/src/org/traccar/web/shared/model/UserSettings.java b/src/org/traccar/web/shared/model/UserSettings.java
new file mode 100644
index 00000000..f7163a16
--- /dev/null
+++ b/src/org/traccar/web/shared/model/UserSettings.java
@@ -0,0 +1,37 @@
+package org.traccar.web.shared.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="user_settings")
+public class UserSettings implements Serializable {
+
+ private static final long serialVersionUID = 1;
+
+ public UserSettings() {
+ speedUnit = SpeedUnit.knots;
+ }
+
+ public enum SpeedUnit {
+ knots,
+ kilometersPerHour,
+ milesPerHour
+ }
+
+ @Enumerated(EnumType.STRING)
+ private SpeedUnit speedUnit;
+
+ public void setSpeedUnit(SpeedUnit speedUnit) {
+ this.speedUnit = speedUnit;
+ }
+
+ public SpeedUnit getSpeedUnit() {
+ return speedUnit;
+ }
+
+}