diff --git a/.idea/artifacts/LO53_mobile_localization_war.xml b/.idea/artifacts/LO53_mobile_localization_war.xml
new file mode 100644
index 0000000..a1056cd
--- /dev/null
+++ b/.idea/artifacts/LO53_mobile_localization_war.xml
@@ -0,0 +1,8 @@
+
+
+ $PROJECT_DIR$/target
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/artifacts/LO53_mobile_localization_war_exploded.xml b/.idea/artifacts/LO53_mobile_localization_war_exploded.xml
new file mode 100644
index 0000000..8b5dcfb
--- /dev/null
+++ b/.idea/artifacts/LO53_mobile_localization_war_exploded.xml
@@ -0,0 +1,44 @@
+
+
+ $PROJECT_DIR$/target/mobile_localization-1.0-SNAPSHOT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..ea77f66
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 0000000..bd47f4e
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ postgresql
+ true
+ org.postgresql.Driver
+ jdbc:postgresql://localhost:5432/LO53
+
+
+ postgresql
+ true
+ true
+ $PROJECT_DIR$/src/main/resources/hibernate.cfg.xml
+ org.postgresql.Driver
+ jdbc:postgresql://localhost:5432/LO53
+
+
+ file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/PostgreSQL/9.4-1201/postgresql-9.4-1201.jdbc4.jar
+
+
+ file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/PostgreSQL/9.4-1201/postgresql-driver-license.txt
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23.xml b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23.xml
new file mode 100644
index 0000000..6693114
--- /dev/null
+++ b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23.xml
@@ -0,0 +1,251 @@
+
+
+
+
+
+ 30998
+ 1
+ 1
+
+
+ 2200
+ 2017-05-31.07:36:16.132
+ 11286
+ 1
+ 1
+
+
+ 11
+
+
+ 99
+
+
+ 11848
+
+
+ 11849
+
+
+ 12113
+
+
+ 35521
+ 11277
+ 1
+
+
+
+
+
+
+ 1
+ integer|0
+ 1
+ 11278
+
+
+ 2
+ varchar(18)|0
+ 11278
+
+
+ 3
+ integer|0
+ 11278
+
+
+ 35526
+ id
+ 1
+
+
+ 35546
+ mac_address
+ 1
+
+
+ 35527
+ id
+ accesspoint_pkey
+ 1
+
+
+ 35547
+ mac_address
+ uk_58em6b5lhouv812y1d05nwv9w
+
+
+ 35548
+ location_id_id
+ location
+ location_pkey
+ id
+
+
+ 1
+ integer|0
+ 1
+ 11279
+
+
+ 2
+ double precision|0
+ 1
+ 11279
+
+
+ 3
+ double precision|0
+ 1
+ 11279
+
+
+ 4
+ integer|0
+ 11279
+
+
+ 35531
+ id
+ 1
+
+
+ 35532
+ id
+ location_pkey
+ 1
+
+
+ 35553
+ map_id
+ map
+ map_pkey
+ id
+
+
+ 1
+ integer|0
+ 1
+ 11280
+
+
+ 2
+ bytea|0
+ 11280
+
+
+ 3
+ varchar(100)|0
+ 11280
+
+
+ 4
+ double precision|0
+ 1
+ 11280
+
+
+ 5
+ double precision|0
+ 1
+ 11280
+
+
+ 6
+ integer|0
+ 1
+ 11280
+
+
+ 7
+ integer|0
+ 1
+ 11280
+
+
+ 35539
+ id
+ 1
+
+
+ 35540
+ id
+ map_pkey
+ 1
+
+
+ 1
+ integer|0
+ 1
+ 11281
+
+
+ 2
+ integer|0
+ 1
+ 11281
+
+
+ 3
+ integer|0
+ 1
+ 11281
+
+
+ 4
+ double precision|0
+ 1
+ 11281
+
+
+ 5
+ integer|0
+ 11281
+
+
+ 6
+ integer|0
+ 11281
+
+
+ 35544
+ accesspointid
+locationid
+ 1
+
+
+ 35545
+ accesspointid
+locationid
+ rssi_pkey
+ 1
+
+
+ 35558
+ accesspoint_id
+ accesspoint
+ accesspoint_pkey
+ id
+
+
+ 35563
+ location_id
+ location
+ location_pkey
+ id
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata
new file mode 100644
index 0000000..615afc4
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.keystream b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.keystream
new file mode 100644
index 0000000..e9901a0
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.keystream differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.keystream.len b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.keystream.len
new file mode 100644
index 0000000..4b05c55
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.keystream.len differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.len b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.len
new file mode 100644
index 0000000..60e2d8a
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.len differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.values.at b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.values.at
new file mode 100644
index 0000000..1086822
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata.values.at differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata_i b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata_i
new file mode 100644
index 0000000..22bd9a0
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata_i differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata_i.len b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata_i.len
new file mode 100644
index 0000000..131e265
Binary files /dev/null and b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/_metadata_/metadata_i.len differ
diff --git a/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/storage.xml b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/storage.xml
new file mode 100644
index 0000000..dcfde27
--- /dev/null
+++ b/.idea/dataSources/767b098c-c5bc-42ee-b3bc-d02e521ecc23/storage.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820.xml b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820.xml
new file mode 100644
index 0000000..950dbf4
--- /dev/null
+++ b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ 16454
+ 1
+ 1
+
+
+ 2200
+ 2017-05-04.09:49:48.812
+ 1
+ 1
+
+
+ 11
+
+
+ 99
+
+
+ 11848
+
+
+ 11849
+
+
+ 12113
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata
new file mode 100644
index 0000000..dec6903
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.keystream b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.keystream
new file mode 100644
index 0000000..e9901a0
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.keystream differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.keystream.len b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.keystream.len
new file mode 100644
index 0000000..4b05c55
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.keystream.len differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.len b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.len
new file mode 100644
index 0000000..60e2d8a
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.len differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.values.at b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.values.at
new file mode 100644
index 0000000..8395350
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata.values.at differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata_i b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata_i
new file mode 100644
index 0000000..22bd9a0
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata_i differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata_i.len b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata_i.len
new file mode 100644
index 0000000..131e265
Binary files /dev/null and b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/_metadata_/metadata_i.len differ
diff --git a/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/storage.xml b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/storage.xml
new file mode 100644
index 0000000..dcfde27
--- /dev/null
+++ b/.idea/dataSources/e8821dd5-920f-4867-a7e5-2a062b734820/storage.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__antlr_antlr_2_7_7.xml b/.idea/libraries/Maven__antlr_antlr_2_7_7.xml
new file mode 100644
index 0000000..b8d93d8
--- /dev/null
+++ b/.idea/libraries/Maven__antlr_antlr_2_7_7.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__com_fasterxml_classmate_1_3_0.xml b/.idea/libraries/Maven__com_fasterxml_classmate_1_3_0.xml
new file mode 100644
index 0000000..073c2de
--- /dev/null
+++ b/.idea/libraries/Maven__com_fasterxml_classmate_1_3_0.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_3.xml b/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_3.xml
new file mode 100644
index 0000000..687a60e
--- /dev/null
+++ b/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml b/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml
new file mode 100644
index 0000000..13afda2
--- /dev/null
+++ b/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml b/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml
new file mode 100644
index 0000000..eab40b3
--- /dev/null
+++ b/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml b/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml
new file mode 100644
index 0000000..14681ee
--- /dev/null
+++ b/.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_annotation_jsr250_api_1_0.xml b/.idea/libraries/Maven__javax_annotation_jsr250_api_1_0.xml
new file mode 100644
index 0000000..e367958
--- /dev/null
+++ b/.idea/libraries/Maven__javax_annotation_jsr250_api_1_0.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_el_el_api_2_2.xml b/.idea/libraries/Maven__javax_el_el_api_2_2.xml
new file mode 100644
index 0000000..069511b
--- /dev/null
+++ b/.idea/libraries/Maven__javax_el_el_api_2_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_enterprise_cdi_api_1_1.xml b/.idea/libraries/Maven__javax_enterprise_cdi_api_1_1.xml
new file mode 100644
index 0000000..d54bc25
--- /dev/null
+++ b/.idea/libraries/Maven__javax_enterprise_cdi_api_1_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_inject_javax_inject_1.xml b/.idea/libraries/Maven__javax_inject_javax_inject_1.xml
new file mode 100644
index 0000000..93cf65a
--- /dev/null
+++ b/.idea/libraries/Maven__javax_inject_javax_inject_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__junit_junit_4_12.xml b/.idea/libraries/Maven__junit_junit_4_12.xml
new file mode 100644
index 0000000..d411041
--- /dev/null
+++ b/.idea/libraries/Maven__junit_junit_4_12.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__log4j_log4j_1_2_14.xml b/.idea/libraries/Maven__log4j_log4j_1_2_14.xml
new file mode 100644
index 0000000..2825a67
--- /dev/null
+++ b/.idea/libraries/Maven__log4j_log4j_1_2_14.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_geronimo_specs_geronimo_jta_1_1_spec_1_1_1.xml b/.idea/libraries/Maven__org_apache_geronimo_specs_geronimo_jta_1_1_spec_1_1_1.xml
new file mode 100644
index 0000000..a6f25db
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_geronimo_specs_geronimo_jta_1_1_spec_1_1_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_servlet_api_9_0_0_M15.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_servlet_api_9_0_0_M15.xml
new file mode 100644
index 0000000..cc77d1b
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_tomcat_tomcat_servlet_api_9_0_0_M15.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..f58bbc1
--- /dev/null
+++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_0_1_Final.xml b/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_0_1_Final.xml
new file mode 100644
index 0000000..ce34f42
--- /dev/null
+++ b/.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_5_0_1_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hibernate_hibernate_annotations_3_5_6_Final.xml b/.idea/libraries/Maven__org_hibernate_hibernate_annotations_3_5_6_Final.xml
new file mode 100644
index 0000000..d26bdad
--- /dev/null
+++ b/.idea/libraries/Maven__org_hibernate_hibernate_annotations_3_5_6_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hibernate_hibernate_commons_annotations_3_2_0_Final.xml b/.idea/libraries/Maven__org_hibernate_hibernate_commons_annotations_3_2_0_Final.xml
new file mode 100644
index 0000000..dbb890e
--- /dev/null
+++ b/.idea/libraries/Maven__org_hibernate_hibernate_commons_annotations_3_2_0_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hibernate_hibernate_core_5_2_5_Final.xml b/.idea/libraries/Maven__org_hibernate_hibernate_core_5_2_5_Final.xml
new file mode 100644
index 0000000..07eb2cd
--- /dev/null
+++ b/.idea/libraries/Maven__org_hibernate_hibernate_core_5_2_5_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_0_Final.xml b/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_0_Final.xml
new file mode 100644
index 0000000..6b42b8a
--- /dev/null
+++ b/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_0_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_0_Final.xml b/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_0_Final.xml
new file mode 100644
index 0000000..6492b2b
--- /dev/null
+++ b/.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_1_api_1_0_0_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_javassist_javassist_3_20_0_GA.xml b/.idea/libraries/Maven__org_javassist_javassist_3_20_0_GA.xml
new file mode 100644
index 0000000..c21c9b0
--- /dev/null
+++ b/.idea/libraries/Maven__org_javassist_javassist_3_20_0_GA.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_jboss_jandex_2_0_3_Final.xml b/.idea/libraries/Maven__org_jboss_jandex_2_0_3_Final.xml
new file mode 100644
index 0000000..b841e21
--- /dev/null
+++ b/.idea/libraries/Maven__org_jboss_jandex_2_0_3_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xml b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xml
new file mode 100644
index 0000000..186d87f
--- /dev/null
+++ b/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_jboss_spec_javax_interceptor_jboss_interceptors_api_1_1_spec_1_0_0_Beta1.xml b/.idea/libraries/Maven__org_jboss_spec_javax_interceptor_jboss_interceptors_api_1_1_spec_1_0_0_Beta1.xml
new file mode 100644
index 0000000..8b4d497
--- /dev/null
+++ b/.idea/libraries/Maven__org_jboss_spec_javax_interceptor_jboss_interceptors_api_1_1_spec_1_0_0_Beta1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml
new file mode 100644
index 0000000..0ea470a
--- /dev/null
+++ b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_5_8.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml b/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml
new file mode 100644
index 0000000..f4725a3
--- /dev/null
+++ b/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_5_8.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__postgresql_postgresql_9_1_901_jdbc4.xml b/.idea/libraries/Maven__postgresql_postgresql_9_1_901_jdbc4.xml
new file mode 100644
index 0000000..3e8bb21
--- /dev/null
+++ b/.idea/libraries/Maven__postgresql_postgresql_9_1_901_jdbc4.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..5b6a5c4
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..49f819e
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/LO53_mobile_localization.iml b/LO53_mobile_localization.iml
new file mode 100644
index 0000000..b150b64
--- /dev/null
+++ b/LO53_mobile_localization.iml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..cbf63c4
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,79 @@
+
+
+ 4.0.0
+
+ com.utbm.LO53_mobile_localization
+ mobile_localization
+ 1.0-SNAPSHOT
+ war
+
+
+
+
+ org.apache.tomcat.maven
+ tomcat7-maven-plugin
+ 2.2
+
+ http://localhost:8080/
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.7
+ 1.7
+
+
+
+
+
+
+
+ org.hibernate
+ hibernate-core
+ 5.2.5.Final
+
+
+ org.apache.tomcat
+ tomcat-servlet-api
+ 9.0.0.M15
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.5.8
+ runtime
+
+
+ org.slf4j
+ slf4j-api
+ 1.5.8
+
+
+ postgresql
+ postgresql
+ 9.1-901.jdbc4
+
+
+ org.hibernate
+ hibernate-annotations
+ 3.5.6-Final
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.3
+
+
+ junit
+ junit
+ 4.12
+ test
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/com/lo53_mobile_localization/core/MainClass.java b/src/main/java/com/lo53_mobile_localization/core/MainClass.java
new file mode 100644
index 0000000..07869fe
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/MainClass.java
@@ -0,0 +1,16 @@
+package com.lo53_mobile_localization.core;
+
+import com.lo53_mobile_localization.core.util.HibernateUtil;
+import org.hibernate.Session;
+
+/**
+ * Created by Thomas on 04/05/2017.
+ */
+public class MainClass {
+
+ public static void main (String[] args){
+
+ final Session s = HibernateUtil.getSession();
+ }
+
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/entity/AccessPoint.java b/src/main/java/com/lo53_mobile_localization/core/entity/AccessPoint.java
new file mode 100644
index 0000000..f0b445d
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/entity/AccessPoint.java
@@ -0,0 +1,49 @@
+package com.lo53_mobile_localization.core.entity;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Collection;
+
+/**
+ * Created by Thomas on 03/05/2017.
+ */
+
+@Entity
+public class AccessPoint implements Serializable, IEntity{
+
+ @GeneratedValue
+ @Id
+ private int id;
+
+ @Column(unique=true, length = 18)
+ private String mac_address;
+
+ @OneToOne
+ private Location location_id;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getMac_address() {
+ return mac_address;
+ }
+
+ public void setMac_address(String mac_address) {
+ this.mac_address = mac_address;
+ }
+
+ public Location getLocation_id() {
+ return location_id;
+ }
+
+ public void setLocation_id(Location location_id) {
+ this.location_id = location_id;
+ }
+
+
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/entity/IEntity.java b/src/main/java/com/lo53_mobile_localization/core/entity/IEntity.java
new file mode 100644
index 0000000..9beb4a1
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/entity/IEntity.java
@@ -0,0 +1,8 @@
+package com.lo53_mobile_localization.core.entity;
+
+/**
+ * Created by Thomas on 03/05/2017.
+ */
+public interface IEntity {
+ int getId();
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/entity/Location.java b/src/main/java/com/lo53_mobile_localization/core/entity/Location.java
new file mode 100644
index 0000000..d128085
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/entity/Location.java
@@ -0,0 +1,57 @@
+package com.lo53_mobile_localization.core.entity;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Created by Thomas on 03/05/2017.
+ */
+
+@Entity
+public class Location implements Serializable, IEntity{
+
+ @GeneratedValue
+ @Id
+ private int id;
+
+ private double x;
+
+ private double y;
+
+ @ManyToOne
+ private Map map;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public double getX() {
+ return x;
+ }
+
+ public void setX(double x) {
+ this.x = x;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+ public void setY(double y) {
+ this.y = y;
+ }
+
+ public Map getMap() {
+ return map;
+ }
+
+ public void setMap(Map map) {
+ this.map = map;
+ }
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/entity/Map.java b/src/main/java/com/lo53_mobile_localization/core/entity/Map.java
new file mode 100644
index 0000000..9b10dfb
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/entity/Map.java
@@ -0,0 +1,85 @@
+package com.lo53_mobile_localization.core.entity;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * Created by Thomas on 03/05/2017.
+ */
+@Entity
+public class Map implements Serializable, IEntity{
+
+ @GeneratedValue
+ @Id
+ private int id;
+
+ @Column(length = 100)
+ private String description;
+
+ private int px_width;
+
+ private int px_height;
+
+ private double m_width;
+
+ private double m_height;
+
+ private byte [] content;
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public int getPx_width() {
+ return px_width;
+ }
+
+ public void setPx_width(int px_width) {
+ this.px_width = px_width;
+ }
+
+ public int getPx_height() {
+ return px_height;
+ }
+
+ public void setPx_height(int px_height) {
+ this.px_height = px_height;
+ }
+
+ public double getM_width() {
+ return m_width;
+ }
+
+ public void setM_width(double m_width) {
+ this.m_width = m_width;
+ }
+
+ public double getM_height() {
+ return m_height;
+ }
+
+ public void setM_height(double m_height) {
+ this.m_height = m_height;
+ }
+
+ public byte[] getContent() {
+ return content;
+ }
+
+ public void setContent(byte[] content) {
+ this.content = content;
+ }
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/entity/Rssi.java b/src/main/java/com/lo53_mobile_localization/core/entity/Rssi.java
new file mode 100644
index 0000000..02f03d5
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/entity/Rssi.java
@@ -0,0 +1,65 @@
+package com.lo53_mobile_localization.core.entity;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+/**
+ * Created by Thomas on 03/05/2017.
+ */
+
+@Entity
+public class Rssi implements Serializable {
+
+ @EmbeddedId
+ private RssiID id;
+
+ @MapsId("locationId")
+ @JoinColumn(name = "location_id")
+ @OneToOne
+ private Location location;
+
+ @MapsId("accessPointId")
+ @JoinColumn(name = "accessPoint_id")
+ @OneToOne
+ private AccessPoint accessPoint;
+
+ private double value;
+
+ private int occurences;
+
+ public double getValue() {
+ return value;
+ }
+
+ public void setValue(double value) {
+ this.value = value;
+ }
+
+ public int getOccurences() {
+ return occurences;
+ }
+
+ public void setOccurences(int occurences) {
+ this.occurences = occurences;
+ }
+
+ public RssiID getId() {
+ return id;
+ }
+
+ public Location getLocation() {
+ return location;
+ }
+
+ public void setLocation(Location location) {
+ this.location = location;
+ }
+
+ public AccessPoint getAccessPoint() {
+ return accessPoint;
+ }
+
+ public void setAccessPoint(AccessPoint accessPoint) {
+ this.accessPoint = accessPoint;
+ }
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/entity/RssiID.java b/src/main/java/com/lo53_mobile_localization/core/entity/RssiID.java
new file mode 100644
index 0000000..5473651
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/entity/RssiID.java
@@ -0,0 +1,34 @@
+package com.lo53_mobile_localization.core.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+
+/**
+ * Created by Thomas on 18/05/2017.
+ */
+
+@Embeddable
+public class RssiID implements Serializable {
+
+ @Column(name = "location_id")
+ private int locationId;
+ @Column(name = "accessPoint_id")
+ private int accessPointId;
+
+ public int getLocationId() {
+ return locationId;
+ }
+
+ public void setLocationId(int locationId) {
+ this.locationId = locationId;
+ }
+
+ public int getAccessPointId() {
+ return accessPointId;
+ }
+
+ public void setAccessPointId(int accessPointId) {
+ this.accessPointId = accessPointId;
+ }
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/repository/AccessPointDAO.java b/src/main/java/com/lo53_mobile_localization/core/repository/AccessPointDAO.java
new file mode 100644
index 0000000..136cf88
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/repository/AccessPointDAO.java
@@ -0,0 +1,15 @@
+package com.lo53_mobile_localization.core.repository;
+
+import com.lo53_mobile_localization.core.entity.AccessPoint;
+
+/**
+ * Created by Thomas on 10/05/2017.
+ */
+public class AccessPointDAO extends DefaultDAO{
+
+ public AccessPointDAO() {
+ super();
+ entityType = AccessPoint.class;
+ }
+
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/repository/DefaultDAO.java b/src/main/java/com/lo53_mobile_localization/core/repository/DefaultDAO.java
new file mode 100644
index 0000000..9242f2c
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/repository/DefaultDAO.java
@@ -0,0 +1,139 @@
+package com.lo53_mobile_localization.core.repository;
+
+import com.lo53_mobile_localization.core.entity.IEntity;
+import com.lo53_mobile_localization.core.util.HibernateUtil;
+import org.hibernate.HibernateException;
+import org.apache.commons.beanutils.BeanUtils;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.query.Query;
+import org.slf4j.Logger;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+/**
+ * Created by Thomas on 10/05/2017.
+ */
+public abstract class DefaultDAO {
+
+ protected Logger LOGGER;
+ protected Class entityType;
+
+ /**
+ * To insert an entity into the database
+ * @param entity
+ */
+ public void insertEntity(T entity) {
+ Session session = HibernateUtil.getSession();
+ Transaction tr = session.getTransaction();
+ try {
+ tr.begin();
+ session.persist(entity);
+ tr.commit();
+ } catch(Exception e) {
+ LOGGER.error("error in insertEntity: " + e);
+ if(tr != null)
+ tr.rollback();
+ throw e;
+ }
+ }
+
+ /**
+ * To update an entity into the database
+ * @param id
+ * @param entity
+ */
+ public void updateEntity(int id, T entity) throws Exception {
+
+ T storedEntity = getEntity(id);
+
+ try {
+ BeanUtils.copyProperties(storedEntity, entity);
+ } catch (IllegalAccessException|InvocationTargetException e) {
+ LOGGER.error("error in updateEntity: " + e);
+ throw e;
+ }
+
+ Session session = HibernateUtil.getSession();
+ Transaction tr = session.getTransaction();
+ try {
+ tr.begin();
+ session.update(entity);
+ tr.commit();
+ } catch(Exception e) {
+ LOGGER.error("error in updateEntity: " + e);
+ if(tr != null)
+ tr.rollback();
+ throw e;
+ }
+ }
+
+ /**
+ * To remove an entity into the database
+ * @param id
+ */
+ public void removeEntity(int id) throws Exception {
+ IEntity entity = getEntity(id);
+
+ Session session = HibernateUtil.getSession();
+ Transaction tr = session.getTransaction();
+ try {
+ tr.begin();
+ session.delete(entity);
+ tr.commit();
+ } catch(Exception e) {
+ LOGGER.error("error in removeEntity: " + e);
+ if(tr != null)
+ tr.rollback();
+ throw e;
+ }
+ }
+
+ /**
+ * To get an entity from its id and class
+ * @param id
+ * @return
+ */
+ @SuppressWarnings(value="unchecked")
+ public T getEntity(int id) throws Exception {
+ T entity = null;
+
+ Session session = HibernateUtil.getSession();
+ Transaction tr = session.getTransaction();
+ try {
+ tr.begin();
+ entity = (T) session.get(entityType.getCanonicalName(), id);
+ tr.commit();
+ } catch(Exception e) {
+ LOGGER.error("error in getEntity: " + e);
+ if(tr != null)
+ tr.rollback();
+ throw e;
+ }
+
+ return entity;
+ }
+
+ /**
+ * To get all entities
+ * @return
+ */
+ public List getEntities() throws Exception {
+ List listEntities = null;
+
+ Session session = HibernateUtil.getSession();
+ try {
+ Query query = session.createQuery("from " + entityType.getCanonicalName());
+ listEntities = query.list();
+ }catch (HibernateException e) {
+ LOGGER.error("error in getEntities: " + e);
+ throw e;
+ }
+ return listEntities;
+ }
+
+
+
+
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/repository/LocationDAO.java b/src/main/java/com/lo53_mobile_localization/core/repository/LocationDAO.java
new file mode 100644
index 0000000..b1129e0
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/repository/LocationDAO.java
@@ -0,0 +1,17 @@
+package com.lo53_mobile_localization.core.repository;
+
+import com.lo53_mobile_localization.core.entity.Location;
+
+import java.util.List;
+
+/**
+ * Created by Thomas on 10/05/2017.
+ */
+public class LocationDAO extends DefaultDAO {
+
+ public LocationDAO() {
+ super();
+ entityType = Location.class;
+ }
+
+}
diff --git a/src/main/java/com/lo53_mobile_localization/core/repository/MapDAO.java b/src/main/java/com/lo53_mobile_localization/core/repository/MapDAO.java
new file mode 100644
index 0000000..1315159
--- /dev/null
+++ b/src/main/java/com/lo53_mobile_localization/core/repository/MapDAO.java
@@ -0,0 +1,19 @@
+package com.lo53_mobile_localization.core.repository;
+
+import com.lo53_mobile_localization.core.entity.AccessPoint;
+import com.lo53_mobile_localization.core.entity.IEntity;
+import com.lo53_mobile_localization.core.entity.Map;
+
+import java.util.List;
+
+/**
+ * Created by Thomas on 10/05/2017.
+ */
+public class MapDAO extends DefaultDAO