1st version that works
This commit is contained in:
27
libSafeMobile/src/main/java/com/safenet/lib/Account.java
Normal file
27
libSafeMobile/src/main/java/com/safenet/lib/Account.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Account {
|
||||
public long id;
|
||||
public long version;
|
||||
public String companyName;
|
||||
public Date dateCreated;
|
||||
public int emailGatewayId;
|
||||
public int featuresId;
|
||||
public Features features;
|
||||
public boolean isCarrier;
|
||||
public boolean isDeactivated;
|
||||
public boolean isDemo;
|
||||
public Date lastUpdated;
|
||||
|
||||
|
||||
public Account() { }
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | companyName: " + companyName+ " | dateCreated: " + dateCreated + " | emailGatewayId: " + emailGatewayId + " | featuresId: " + featuresId
|
||||
+ " | isCarrier: " + isCarrier + " | isDeactivated: " + isDeactivated + " | isDemo: " + isDemo + " | lastUpdated: " + lastUpdated;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class AccountGateway {
|
||||
|
||||
|
||||
public int accountGatewaysId;
|
||||
public int gatewayId;
|
||||
|
||||
public AccountGateway(){
|
||||
|
||||
}
|
||||
public String toString()
|
||||
{
|
||||
return "accountGatewaysId" + accountGatewaysId + " | gatewayId: " + gatewayId;
|
||||
}
|
||||
|
||||
}
|
24
libSafeMobile/src/main/java/com/safenet/lib/Activity.java
Normal file
24
libSafeMobile/src/main/java/com/safenet/lib/Activity.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Activity {
|
||||
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public String action;
|
||||
public Date dateCreated;
|
||||
public int userId;
|
||||
|
||||
public Activity(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id + "action" + action + "dateCreated" + dateCreated + "userId" + userId;
|
||||
}
|
||||
|
||||
}
|
21
libSafeMobile/src/main/java/com/safenet/lib/Address.java
Normal file
21
libSafeMobile/src/main/java/com/safenet/lib/Address.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class Address {
|
||||
public long id;
|
||||
public long version;
|
||||
public Gateway gateway;
|
||||
public double latitude;
|
||||
public double longitude;
|
||||
public String address;
|
||||
public String addressHash;
|
||||
|
||||
public Address(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | lat: " + latitude + " | long: " + longitude + " | address: " + address + " | gtwCode: " + gateway.code;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AlertDefinition {
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public int accountId;
|
||||
public int createdById;
|
||||
public Date dateCreated;
|
||||
public Date lastUpdated;
|
||||
public int unitId;
|
||||
public int userId;
|
||||
public String mClass;
|
||||
public boolean movesIn;
|
||||
public boolean movesOut;
|
||||
public int landmarkId;
|
||||
public int rangeInMilesLandmark;
|
||||
public int geofenceId;
|
||||
public String digitalAlertDescription;
|
||||
public int digitalValues;
|
||||
public int maxSpeedInMiles;
|
||||
|
||||
|
||||
public AlertDefinition(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id
|
||||
+ "accountId" + accountId
|
||||
+ "createdById" + createdById
|
||||
+ "dateCreated" + dateCreated
|
||||
+ "lastUpdated" + lastUpdated
|
||||
+ "unitId" + unitId
|
||||
+ "userId" + userId
|
||||
+ "mClass" + mClass
|
||||
+ "movesIn" + movesIn
|
||||
+ "movesOut" + movesOut
|
||||
+ "landmarkId" + landmarkId
|
||||
+ "rangeInMilesLandmark" + rangeInMilesLandmark
|
||||
+ "geofenceId" + geofenceId
|
||||
+ "digitalAlertDescription" + digitalAlertDescription
|
||||
+ "digitalValues" + digitalValues
|
||||
+ "maxSpeedInMiles" + maxSpeedInMiles;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class AlertDefinitionAlertDefinitionPeriod {
|
||||
|
||||
|
||||
public int alertDefinitionActivePeriodsId;
|
||||
public int alertDefinitionPeriodId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public AlertDefinitionAlertDefinitionPeriod(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "alertDefinitionActivePeriodsId" + alertDefinitionActivePeriodsId
|
||||
+ "alertDefinitionPeriodId" + alertDefinitionPeriodId;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class AlertDefinitionContact {
|
||||
|
||||
public int alertDefinitionRecipientsId;
|
||||
public int ContactId;
|
||||
|
||||
public AlertDefinitionContact(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "alertDefinitionRecipientsId" + alertDefinitionRecipientsId
|
||||
+ "ContactId" + ContactId;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class AlertDefinitionPeriod {
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public boolean allDay;
|
||||
public int timeEnd;
|
||||
public int timeStart;
|
||||
public String weekday;
|
||||
|
||||
public AlertDefinitionPeriod(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id
|
||||
+ "allDay" + allDay
|
||||
+ "timeEnd" + timeEnd
|
||||
+ "timeStart" + timeStart
|
||||
+ "weekday" + weekday ;
|
||||
}
|
||||
}
|
36
libSafeMobile/src/main/java/com/safenet/lib/AlertEvent.java
Normal file
36
libSafeMobile/src/main/java/com/safenet/lib/AlertEvent.java
Normal file
@ -0,0 +1,36 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AlertEvent {
|
||||
|
||||
|
||||
public long id = -1;
|
||||
public long version = 1;
|
||||
public int alertTypeId = 88888;
|
||||
public Date dateCreated = new Date(10000);
|
||||
public boolean isAcknowledged = true;
|
||||
public boolean isDisplayed = true;
|
||||
public boolean isSent = true;
|
||||
public int unitId;
|
||||
public String unitName;
|
||||
|
||||
public Date position_message_message_time;
|
||||
public int position_message_unit_id;
|
||||
public String time;
|
||||
|
||||
public AlertEvent(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id = " + id
|
||||
+ " | alertTypeId = " + alertTypeId
|
||||
+ " | dateCreated = " + dateCreated
|
||||
+ " | isAcknowledged = " + isAcknowledged
|
||||
+ " | isDisplayed = " + isDisplayed
|
||||
+ " | isSent = " + isSent
|
||||
+ " | unitId = " + unitId ;
|
||||
}
|
||||
}
|
23
libSafeMobile/src/main/java/com/safenet/lib/ArsMessage.java
Normal file
23
libSafeMobile/src/main/java/com/safenet/lib/ArsMessage.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ArsMessage {
|
||||
|
||||
|
||||
public Date message_time;
|
||||
public long unitId;
|
||||
public boolean isOn;
|
||||
public String suid;
|
||||
|
||||
|
||||
|
||||
public ArsMessage(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "message_time: " + message_time + " | unitId: " + unitId + " | is_on: " + isOn ;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CompanyAccount {
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public int accountId;
|
||||
public Date dateCreated;
|
||||
public int featuresId;
|
||||
public boolean isDeactivated;
|
||||
public Date lastUpdated;
|
||||
public String name;
|
||||
|
||||
|
||||
public CompanyAccount(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id
|
||||
+ "accountId" + accountId
|
||||
+ "dateCreated" + dateCreated
|
||||
+ "featuresId" + featuresId
|
||||
+ "isDeactivated" + isDeactivated
|
||||
+ "lastUpdated" + lastUpdated
|
||||
+ "name" + name ;
|
||||
}
|
||||
}
|
26
libSafeMobile/src/main/java/com/safenet/lib/Contact.java
Normal file
26
libSafeMobile/src/main/java/com/safenet/lib/Contact.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
public class Contact {
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public Date dateCreated;
|
||||
public int accountId;
|
||||
public String firstName;
|
||||
public String lastName;
|
||||
public String email;
|
||||
public String phoneNumber;
|
||||
|
||||
public Contact(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# CONTACT # id: " + id + " | firstName: " + firstName + " | lastName: " + lastName + " | email: " + (email == null ? "null" : email) +
|
||||
" | phoneNumber: " + (phoneNumber == null ? "null" : phoneNumber);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class EmailGateway {
|
||||
|
||||
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public boolean cannotConnect;
|
||||
public String emailAddress;
|
||||
public int pingIntervalSeconds;
|
||||
|
||||
|
||||
|
||||
public EmailGateway(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id
|
||||
+ "cannotConnect" + cannotConnect
|
||||
+ "emailAddress" + emailAddress
|
||||
+ "pingIntervalSeconds" + pingIntervalSeconds;
|
||||
}
|
||||
}
|
26
libSafeMobile/src/main/java/com/safenet/lib/Features.java
Normal file
26
libSafeMobile/src/main/java/com/safenet/lib/Features.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class Features {
|
||||
public long id;
|
||||
public long version;
|
||||
|
||||
public boolean geofence = true;
|
||||
public boolean landmarks = true;
|
||||
public boolean textMessaging = true;
|
||||
public boolean reports = true;
|
||||
public boolean enhancedReports = false;
|
||||
public boolean emailGateway = false;
|
||||
public boolean live = true;
|
||||
public boolean history = true;
|
||||
public boolean alerts = false;
|
||||
|
||||
public Features(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | alerts: " + alerts + " | email: " + emailGateway + " | enRep: " + enhancedReports + " | reports: " + reports +
|
||||
" | geofence: " + geofence + " | landmark: " + landmarks + " | history: " + history + " | live: " + live + " | text: " + textMessaging;
|
||||
}
|
||||
}
|
20
libSafeMobile/src/main/java/com/safenet/lib/Gateway.java
Normal file
20
libSafeMobile/src/main/java/com/safenet/lib/Gateway.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class Gateway {
|
||||
public long id;
|
||||
public long version;
|
||||
public long code;
|
||||
public long type_id;
|
||||
public long account_id;
|
||||
public long contr_id;
|
||||
public Gateway(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | code: " + code + " | account_id: " + account_id +
|
||||
" | contr_id: " + contr_id + " | type_id: " + type_id + " | version: " + version;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class GatewayStatus {
|
||||
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public Date dateCreated;
|
||||
public int gatewayId;
|
||||
public boolean isOn;
|
||||
public String radioip;
|
||||
|
||||
public GatewayStatus(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id
|
||||
+ "dateCreated" + dateCreated
|
||||
+ "gatewayId" + gatewayId
|
||||
+ "isOn" + isOn
|
||||
+ "radioip" + radioip;
|
||||
}
|
||||
}
|
27
libSafeMobile/src/main/java/com/safenet/lib/Geofence.java
Normal file
27
libSafeMobile/src/main/java/com/safenet/lib/Geofence.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
|
||||
public class Geofence {
|
||||
public long id = -1;
|
||||
public long version = 1;
|
||||
public Date dateCreated;
|
||||
public String edge_color;
|
||||
public String fill_color;
|
||||
public Date lastUpdated;
|
||||
public String name;
|
||||
public String opacity;
|
||||
public int type;
|
||||
public Vector<LatLngPoint> points = new Vector<LatLngPoint>();
|
||||
public Long userId;
|
||||
|
||||
public Geofence(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# Geofence # name: " + name + " | points: " + points.size() + " | user_id: " + userId;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class GeofencePointsId {
|
||||
|
||||
public int geofencePointsId;
|
||||
public int latLngPointId;
|
||||
public int pointsIdx;
|
||||
|
||||
|
||||
public GeofencePointsId(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "geofencePointsId" + geofencePointsId
|
||||
+ "latLngPointId" + latLngPointId
|
||||
+ "pointsIdx" + pointsIdx;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
|
||||
public class HistoryIntervalData {
|
||||
|
||||
public Unit unit;
|
||||
public Date from;
|
||||
public Date to;
|
||||
public String intervalName;
|
||||
public Vector<LastPosition> positionsGMT;
|
||||
public long maxPositions=-1;
|
||||
public boolean filtered=true;
|
||||
|
||||
|
||||
public HistoryIntervalData(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "unit: " + unit + " | from: " + from + " | to: " + to + " | intervalName: " + intervalName + " | maxPositions: " + maxPositions;
|
||||
}
|
||||
}
|
26
libSafeMobile/src/main/java/com/safenet/lib/Landmark.java
Normal file
26
libSafeMobile/src/main/java/com/safenet/lib/Landmark.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Landmark {
|
||||
public long id = -1;
|
||||
public String name;
|
||||
public LatLngPoint point;
|
||||
public int radius;
|
||||
public int color; //background color
|
||||
public String icon="images/02/16/21.png";
|
||||
public Date dateCreated;
|
||||
public Date lastUpdated;
|
||||
public Long userId;
|
||||
public String schema;
|
||||
|
||||
public Landmark(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# Landmark #\n name: " + name + " | radius: " + radius + " | " + point.toString();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class LastPosition {
|
||||
|
||||
// H7 LastPosition atributes
|
||||
public long id;
|
||||
public Date positionTime;
|
||||
public double latitude;
|
||||
public double longitude;
|
||||
public int speed;
|
||||
public boolean digitalIn;
|
||||
public boolean digitalOut;
|
||||
public Date arsTime;
|
||||
public boolean isOn;
|
||||
public long unit_id;
|
||||
public String unitName ="";
|
||||
public Address address = null;
|
||||
|
||||
// H7 Position && PositionMessage
|
||||
|
||||
public LastPosition(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# POSITION #\n id: " + unit_id +
|
||||
" | address: " + (address == null? "null" : address.address) +
|
||||
" | lat: " + latitude + " | long: " + longitude +
|
||||
" | speed: " + speed;
|
||||
}
|
||||
|
||||
}
|
31
libSafeMobile/src/main/java/com/safenet/lib/LatLngPoint.java
Normal file
31
libSafeMobile/src/main/java/com/safenet/lib/LatLngPoint.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class LatLngPoint {
|
||||
public long id;
|
||||
public double latitude;
|
||||
public double longitude;
|
||||
public String address = "";
|
||||
|
||||
public LatLngPoint(){
|
||||
|
||||
}
|
||||
|
||||
public LatLngPoint(long id, double lat, double lng)
|
||||
{
|
||||
this.id = id;
|
||||
latitude = lat;
|
||||
longitude = lng;
|
||||
}
|
||||
|
||||
|
||||
public LatLngPoint(double lat, double lng, String address){
|
||||
latitude = lat;
|
||||
longitude = lng;
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "lat: " + latitude + " | long: " + longitude + " | address: " + address;
|
||||
}
|
||||
}
|
34
libSafeMobile/src/main/java/com/safenet/lib/LicensePack.java
Normal file
34
libSafeMobile/src/main/java/com/safenet/lib/LicensePack.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class LicensePack {
|
||||
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public Date PODate;
|
||||
public String PONumber;
|
||||
public int POValue;
|
||||
public int accountId;
|
||||
public Date dateCreated;
|
||||
public int numberOfRadioLicences;
|
||||
public int numberOfUsuers;
|
||||
|
||||
public LicensePack(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id" + id
|
||||
+ "PODate" + PODate
|
||||
+ "PONumber" + PONumber
|
||||
+ "POValue" + POValue
|
||||
+ "accountId" + accountId
|
||||
+ "dateCreated" + dateCreated
|
||||
+ "numberOfRadioLicences" + numberOfRadioLicences
|
||||
+ "numberOfUsuers" + numberOfUsuers;
|
||||
}
|
||||
}
|
34
libSafeMobile/src/main/java/com/safenet/lib/Poll.java
Normal file
34
libSafeMobile/src/main/java/com/safenet/lib/Poll.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Poll {
|
||||
|
||||
public long id = -1;
|
||||
public long version;
|
||||
public Date dateCreated;
|
||||
public boolean isRead;
|
||||
public boolean isSent;
|
||||
public Date positionMessage_message_time;
|
||||
public int positionMessageUnitId;
|
||||
public PositionMessage positionMessage;
|
||||
public boolean responded;
|
||||
public long unitId;
|
||||
public String unitName;
|
||||
|
||||
public Poll(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id
|
||||
+ " | dateCreated: " + dateCreated
|
||||
+ " | isRead: " + isRead
|
||||
+ " | isSent: " + isSent
|
||||
+ " | responded: " + responded
|
||||
+ " | unitId: " + unitId
|
||||
+ " | unitName: "+ unitName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class PositionMessage {
|
||||
|
||||
public Date messageTime;
|
||||
public long unitId;
|
||||
public String addressHash;
|
||||
public boolean digitalIn;
|
||||
public boolean digitalOut;
|
||||
public double latitude;
|
||||
public double longitude;
|
||||
public int speed;
|
||||
public int type = 33;
|
||||
|
||||
public PositionMessage(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# PositionMessage #\n unitId: " + unitId + " | lat: " + latitude + " | long: " + longitude + " | speed: " + speed;
|
||||
}
|
||||
|
||||
}
|
24
libSafeMobile/src/main/java/com/safenet/lib/Settings.java
Normal file
24
libSafeMobile/src/main/java/com/safenet/lib/Settings.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class Settings {
|
||||
public long id;
|
||||
public long version;
|
||||
public String language = "";
|
||||
public String lastTab = "";
|
||||
public boolean mph = true;
|
||||
public String openedTabs = "";
|
||||
public boolean militaryTime;
|
||||
public int refreshIntervalSec;
|
||||
public int historyLimit;
|
||||
public int reportLimit;
|
||||
|
||||
public Settings(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# SETTINGS # id: " + id + " | language: " + language + " | lastTab: " + lastTab + " | openedTabs: " + openedTabs + " | mph: " + mph;
|
||||
}
|
||||
|
||||
}
|
78
libSafeMobile/src/main/java/com/safenet/lib/TextMessage.java
Normal file
78
libSafeMobile/src/main/java/com/safenet/lib/TextMessage.java
Normal file
@ -0,0 +1,78 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class TextMessage {
|
||||
|
||||
|
||||
public long id;
|
||||
public long version;
|
||||
public Date dateCreated;
|
||||
public boolean isRead, isSent;
|
||||
public String messageContent;
|
||||
public String messageType;
|
||||
public Date timeSentOrReceived;
|
||||
public long unitId;
|
||||
public String subscriber;
|
||||
|
||||
public TextMessage(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id
|
||||
+ " | dateCreated: " + dateCreated
|
||||
+ " | type: " + messageType
|
||||
+ " | isRead: " + isRead
|
||||
+ " | isSent: " + isSent
|
||||
+ " | messageContent: " + messageContent
|
||||
+ " | timeSentOrReceived: " + timeSentOrReceived
|
||||
+ " | unitId: " + unitId;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static long getLocalOffsetMs(){
|
||||
//System.out.println("timezoneoffset = "+new Date().getTimezoneOffset()*60*1000);
|
||||
return -(new Date().getTimezoneOffset()*60 *1000);
|
||||
|
||||
}
|
||||
|
||||
public static Date getUTC(Date local){
|
||||
|
||||
long offsetMs = getLocalOffsetMs();
|
||||
Date res = local;
|
||||
if (local!=null)
|
||||
res = new Date(local.getTime()-offsetMs);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static Date getLocal(Date gmt){
|
||||
//System.out.print(getLocalOffsetMs()+" ");
|
||||
//System.out.print(gmt+" ");
|
||||
//System.out.println(new Date(gmt.getTime()+getLocalOffsetMs()));
|
||||
//TimeZone gmttz = TimeZone.createTimeZone(0);
|
||||
//String formatted = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(gmt, gmttz);
|
||||
//System.out.println(formatted);
|
||||
return new Date(gmt.getTime()+getLocalOffsetMs());
|
||||
}
|
||||
|
||||
/*
|
||||
public static String getUTC(Date local)
|
||||
{
|
||||
DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
TimeZone gmtTime = TimeZone.getTimeZone("UTC");
|
||||
utcFormat.setTimeZone(gmtTime);
|
||||
|
||||
return utcFormat.format(local);
|
||||
}
|
||||
|
||||
public static Date getLocal(Date utc)
|
||||
{
|
||||
long utcMiliseconds = utc.getTime();
|
||||
GregorianCalendar cal = new GregorianCalendar();
|
||||
cal.setTimeInMillis(utcMiliseconds);
|
||||
return new Date(utcMiliseconds + cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET));
|
||||
}
|
||||
*/
|
||||
}
|
29
libSafeMobile/src/main/java/com/safenet/lib/Unit.java
Normal file
29
libSafeMobile/src/main/java/com/safenet/lib/Unit.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Unit {
|
||||
public long id;
|
||||
public String name;
|
||||
public Date dateCreated;
|
||||
public Date lastUpdated;
|
||||
|
||||
public int reportingSeconds = 60;
|
||||
public boolean isDeactivated; //if User wants to create another one with the same name then resurrect this one
|
||||
public String emailAddress;
|
||||
public UnitIcon icon;
|
||||
public UnitGroup group = null;
|
||||
public UnitType type;
|
||||
public Gateway gateway; //if it is radio then will have a gateway, otherwise is null
|
||||
public long imei;
|
||||
|
||||
public Unit(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | name: " + name + " | imei:" + imei + " | repSec:" + reportingSeconds;
|
||||
}
|
||||
|
||||
}
|
18
libSafeMobile/src/main/java/com/safenet/lib/UnitGroup.java
Normal file
18
libSafeMobile/src/main/java/com/safenet/lib/UnitGroup.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class UnitGroup {
|
||||
public long id;
|
||||
public String name;
|
||||
public long version = 1;
|
||||
public long account_id;
|
||||
|
||||
public UnitGroup(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | name: " + name + " | version: " + version;
|
||||
}
|
||||
|
||||
}
|
18
libSafeMobile/src/main/java/com/safenet/lib/UnitIcon.java
Normal file
18
libSafeMobile/src/main/java/com/safenet/lib/UnitIcon.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class UnitIcon {
|
||||
public long id;
|
||||
public String name;
|
||||
public String path;
|
||||
public long version;
|
||||
|
||||
public UnitIcon(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | name: " + name + " | path: "+ path + " | version: " + version;
|
||||
}
|
||||
|
||||
}
|
18
libSafeMobile/src/main/java/com/safenet/lib/UnitType.java
Normal file
18
libSafeMobile/src/main/java/com/safenet/lib/UnitType.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
public class UnitType {
|
||||
public long id;
|
||||
public String name;
|
||||
public long version;
|
||||
public String logo;
|
||||
|
||||
public UnitType(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "id: " + id + " | name: " + name + " | version: " + version;
|
||||
}
|
||||
|
||||
}
|
37
libSafeMobile/src/main/java/com/safenet/lib/User.java
Normal file
37
libSafeMobile/src/main/java/com/safenet/lib/User.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.safenet.lib;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
public class User {
|
||||
public long id;
|
||||
public long version;
|
||||
public Date dateCreated = new Date(1000);
|
||||
public Date lastUpdated= new Date(1000);;
|
||||
public String login = "test";
|
||||
public String password = "test";
|
||||
public Contact self;
|
||||
public int tzoOffset = 1;
|
||||
public int historyLimit = 1000;
|
||||
public int reportLimit = 1000;
|
||||
|
||||
public boolean isDeactivated = false;
|
||||
public boolean isAdmin = false; //will login to Account admin
|
||||
public boolean isGod = false; //will login as Overall admin
|
||||
|
||||
public Features features;
|
||||
public Settings settings;
|
||||
|
||||
public long account_id = 1;
|
||||
public long company_id = 1;
|
||||
public String note;
|
||||
|
||||
public User(){
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "# USER #\n id: " + id + " | login: " + login + " | password: " + password + " | " + (self!=null?self.toString():"");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user