diff --git a/README.md b/README.md
index eb0c440..08f45bb 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
+# Download the "JAR.FILE.IS.IN.HERE" zip file from final release, extract and run the .jar file
+there are a few example databases in that zip as well, however you can delete the .json files in case you do not need any example data
+
+
+
+
+
+
# Remote-Container-Management
Use Eclipse to edit the repository by either pulling, or committing and pushing.
@@ -9,8 +17,3 @@ Thereafter, when starting a work session, be sure to pull in order to get the up
The convetion for writing packages: myPackage;
classes: Class;
methods: method.
-
-
-
-
-
diff --git a/System/.classpath b/System/.classpath
index f4bf436..c3f70d9 100644
--- a/System/.classpath
+++ b/System/.classpath
@@ -18,11 +18,7 @@
-
-
-
-
-
+
diff --git a/System/.settings/org.eclipse.jdt.core.prefs b/System/.settings/org.eclipse.jdt.core.prefs
index 741b8a7..5208f74 100644
--- a/System/.settings/org.eclipse.jdt.core.prefs
+++ b/System/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/System/UMLdiagram.png b/System/UMLdiagram.png
new file mode 100644
index 0000000..8931be8
Binary files /dev/null and b/System/UMLdiagram.png differ
diff --git a/System/UMLdiagram.ucls b/System/UMLdiagram.ucls
new file mode 100644
index 0000000..3d85342
--- /dev/null
+++ b/System/UMLdiagram.ucls
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/System/cargo_blue.gif b/System/cargo_blue.gif
new file mode 100644
index 0000000..9e535f0
Binary files /dev/null and b/System/cargo_blue.gif differ
diff --git a/System/client_database.json b/System/client_database.json
new file mode 100644
index 0000000..fcab2f2
--- /dev/null
+++ b/System/client_database.json
@@ -0,0 +1,81 @@
+{
+ "clients" : [ {
+ "myContainers" : [ ],
+ "myJourneys" : {
+ "journeys" : { }
+ },
+ "id" : 1,
+ "fistName" : "Alan",
+ "lastName" : "Mansour",
+ "birthDate" : "21/04/2021",
+ "email" : "Alan.Mansour@mail.com",
+ "password" : "0000",
+ "phoneNumber" : "0000000001",
+ "friends" : [ ]
+ }, {
+ "myContainers" : [ ],
+ "myJourneys" : {
+ "journeys" : { }
+ },
+ "id" : 2,
+ "fistName" : "Javier",
+ "lastName" : "Almendra",
+ "birthDate" : "21/04/2021",
+ "email" : "Javier.Almendra@mail.com",
+ "password" : "0000",
+ "phoneNumber" : "0000000002",
+ "friends" : [ ]
+ }, {
+ "myContainers" : [ ],
+ "myJourneys" : {
+ "journeys" : { }
+ },
+ "id" : 3,
+ "fistName" : "Kristyn",
+ "lastName" : "Korboe",
+ "birthDate" : "21/04/2021",
+ "email" : "Kristyn.Korboe@mail.com",
+ "password" : "0000",
+ "phoneNumber" : "0000000003",
+ "friends" : [ ]
+ }, {
+ "myContainers" : [ ],
+ "myJourneys" : {
+ "journeys" : { }
+ },
+ "id" : 4,
+ "fistName" : "Ousama",
+ "lastName" : "Mhadden",
+ "birthDate" : "21/04/2021",
+ "email" : "Ousama.Mhadden@mail.com",
+ "password" : "0000",
+ "phoneNumber" : "0000000004",
+ "friends" : [ ]
+ }, {
+ "myContainers" : [ ],
+ "myJourneys" : {
+ "journeys" : { }
+ },
+ "id" : 5,
+ "fistName" : "Parsa",
+ "lastName" : "Mehrizi",
+ "birthDate" : "21/04/2021",
+ "email" : "Parsa.Mehrizi@mail.com",
+ "password" : "0000",
+ "phoneNumber" : "0000000005",
+ "friends" : [ ]
+ }, {
+ "myContainers" : [ ],
+ "myJourneys" : {
+ "journeys" : { }
+ },
+ "id" : 6,
+ "fistName" : "Sarthak",
+ "lastName" : "Trehan",
+ "birthDate" : "21/04/2021",
+ "email" : "Sarthak.Trehan@mail.com",
+ "password" : "0000",
+ "phoneNumber" : "0000000006",
+ "friends" : [ ]
+ } ]
+}
\ No newline at end of file
diff --git a/System/container_database.json b/System/container_database.json
new file mode 100644
index 0000000..fa1a8bf
--- /dev/null
+++ b/System/container_database.json
@@ -0,0 +1,523 @@
+{
+ "containers" : [ {
+ "containerID" : 1,
+ "owner" : 1,
+ "position" : "Copenhagen",
+ "contentType" : "Fish",
+ "company" : "Captain Fish",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 2,
+ "owner" : 1,
+ "position" : "Copenhagen",
+ "contentType" : "Fish",
+ "company" : "Captain Fish",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 3,
+ "owner" : 4,
+ "position" : "Copenhagen",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 4,
+ "owner" : 4,
+ "position" : "Copenhagen",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 5,
+ "owner" : 4,
+ "position" : "Copenhagen",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 6,
+ "owner" : 4,
+ "position" : "Copenhagen",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 7,
+ "owner" : 4,
+ "position" : "Copenhagen",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
+ "availability" : false,
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 8,
+ "owner" : 0,
+ "position" : "Copenhagen",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 9,
+ "owner" : 0,
+ "position" : "Copenhagen",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 10,
+ "owner" : 0,
+ "position" : "Copenhagen",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 11,
+ "owner" : 3,
+ "position" : "Oslo",
+ "contentType" : "Textile",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "OC32413",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 12,
+ "owner" : 3,
+ "position" : "Oslo",
+ "contentType" : "Textile",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "OC32413",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 13,
+ "owner" : 3,
+ "position" : "Oslo",
+ "contentType" : "Textile",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "OC32413",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 14,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 15,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 16,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 17,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 18,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 19,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 20,
+ "owner" : 0,
+ "position" : "Oslo",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 21,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 22,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 23,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 24,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 25,
+ "owner" : 0,
+ "position" : "Gothenburg",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 26,
+ "owner" : 0,
+ "position" : "Gothenburg",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 27,
+ "owner" : 0,
+ "position" : "Gothenburg",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 28,
+ "owner" : 0,
+ "position" : "Gothenburg",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 29,
+ "owner" : 0,
+ "position" : "Gothenburg",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 30,
+ "owner" : 0,
+ "position" : "Gothenburg",
+ "contentType" : null,
+ "company" : null,
+ "availability" : true,
+ "currentJourney" : null,
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 31,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 32,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 33,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 34,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 35,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 36,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 37,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 38,
+ "owner" : 3,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 39,
+ "owner" : 3,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 40,
+ "owner" : 6,
+ "position" : "Amsterdam",
+ "contentType" : "Tobacco",
+ "company" : "Captain Tobacco",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ } ]
+}
\ No newline at end of file
diff --git a/System/journey_database.json b/System/journey_database.json
index 00bbf28..4755e30 100644
--- a/System/journey_database.json
+++ b/System/journey_database.json
@@ -1,126 +1,321 @@
{
"journeys" : {
- "\"{ID : CO23143, Origin : Copenhagen, Destination : Oslo, Departure : null, Arrival : null}\"" : [ {
+ "\"{ID : CO23143, Origin : Copenhagen, Destination : Oslo, Departure : 21/04/2021, Arrival : 22/04/2021}\"" : [ {
"containerID" : 1,
- "owner" : 100,
+ "owner" : 1,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Fish",
+ "company" : "Captain Fish",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
"containerID" : 2,
- "owner" : 100,
+ "owner" : 1,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Fish",
+ "company" : "Captain Fish",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
"containerID" : 3,
- "owner" : 100,
+ "owner" : 4,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
"containerID" : 4,
- "owner" : 100,
+ "owner" : 4,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
"containerID" : 5,
- "owner" : 100,
+ "owner" : 4,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
"containerID" : 6,
- "owner" : 100,
+ "owner" : 4,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
"containerID" : 7,
- "owner" : 100,
+ "owner" : 4,
"position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "contentType" : "Banana",
+ "company" : "Captain Banana",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "CO23143",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ } ],
+ "\"{ID : AC21003, Origin : Amsterdam, Destination : Copenhagen, Departure : 12/06/2021, Arrival : 15/06/2021}\"" : [ {
+ "containerID" : 31,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
- "containerID" : 8,
- "owner" : 100,
- "position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "containerID" : 32,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
- "containerID" : 9,
- "owner" : 100,
- "position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "containerID" : 33,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
- "containerID" : 10,
- "owner" : 100,
- "position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "containerID" : 34,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 35,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 36,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 37,
+ "owner" : 2,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Flower",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 38,
+ "owner" : 3,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 39,
+ "owner" : 3,
+ "position" : "Amsterdam",
+ "contentType" : "Flowers",
+ "company" : "Captain Textile",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
}, {
+ "containerID" : 40,
+ "owner" : 6,
+ "position" : "Amsterdam",
+ "contentType" : "Tobacco",
+ "company" : "Captain Tobacco",
+ "availability" : false,
+ "currentJourney" : "AC21003",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ } ],
+ "\"{ID : CO22211, Origin : Copenhagen, Destination : Oslo, Departure : 30/04/2021, Arrival : 31/04/2021}\"" : [ ],
+ "\"{ID : OC32413, Origin : Oslo, Destination : Copenhagen, Departure : 29/05/2021, Arrival : 30/05/2021}\"" : [ {
"containerID" : 11,
- "owner" : 100,
- "position" : "Copenhagen",
- "contentType" : "fish",
- "company" : "Banana Company",
+ "owner" : 3,
+ "position" : "Oslo",
+ "contentType" : "Textile",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "OC32413",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 12,
+ "owner" : 3,
+ "position" : "Oslo",
+ "contentType" : "Textile",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "OC32413",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 13,
+ "owner" : 3,
+ "position" : "Oslo",
+ "contentType" : "Textile",
+ "company" : "Captain Textile",
+ "availability" : false,
+ "currentJourney" : "OC32413",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ } ],
+ "\"{ID : GA12147, Origin : Gothenburg, Destination : Amsterdam, Departure : 17/05/2021, Arrival : 19/05/2021}\"" : [ {
+ "containerID" : 21,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 22,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 23,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
+ "availability" : false,
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
+ }, {
+ "containerID" : 24,
+ "owner" : 5,
+ "position" : "Gothenburg",
+ "contentType" : "Plastic",
+ "company" : "Captain Plastic",
"availability" : false,
- "temperature" : 20,
- "humidity" : 21,
- "pressure" : 22,
- "history" : [ [ [ ] ], [ [ 20, 20, 20 ] ], [ [ 21, 21, 21 ] ], [ [ 22, 22, 22 ] ], [ [ "Copenhagen", "Copenhagen", "Copenhagen" ] ] ]
+ "currentJourney" : "GA12147",
+ "temperature" : 0,
+ "humidity" : 0,
+ "pressure" : 0,
+ "date" : null,
+ "history" : [ [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ], [ [ ] ] ]
} ]
}
}
\ No newline at end of file
diff --git a/System/pom.xml b/System/pom.xml
index 3d9bf9a..bc3b6c7 100644
--- a/System/pom.xml
+++ b/System/pom.xml
@@ -4,9 +4,27 @@
System
0.0.1-SNAPSHOT
+
+
+
+ maven-assembly-plugin
+
+
+
+ controller.ApplicationController
+
+
+
+ jar-with-dependencies
+
+
+
+
+
+
- 11
- 11
+ 1.8
+ 1.8
@@ -47,6 +65,12 @@
2.12.2
+
+ org.apache.commons
+ commons-text
+ 1.1
+
+
\ No newline at end of file
diff --git a/System/src/main/java/JsonDatabase.java b/System/src/main/java/JsonDatabase.java
deleted file mode 100644
index 934bd3b..0000000
--- a/System/src/main/java/JsonDatabase.java
+++ /dev/null
@@ -1,101 +0,0 @@
-import java.io.File;
-import java.io.FileReader;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import clientsManagement.Client;
-import journeysManagement.Container;
-import journeysManagement.ContainerDatabase;
-import journeysManagement.Journey;
-import journeysManagement.JourneyDatabase;
-
-public class JsonDatabase {
-
- public static void main(String[] args) throws Exception {
-
- JourneyDatabase journeys = new JourneyDatabase();
- ContainerDatabase containers = new ContainerDatabase();
- ObjectMapper mapper = new ObjectMapper();
-
- JSONObject sampleObject = new JSONObject();
- Files.write(Paths.get("example.json"), sampleObject.toJSONString().getBytes());
-
- Journey journey1 = new Journey();
- journey1.setJourneyID("CO23092");
- journey1.setOrigin("Copenhagen");
- journey1.setDestination("Oslo");
- journeys.create(journey1);
- create("example.json", journey1, journeys);
-
- Journey journey2 = new Journey();
- journey2.setJourneyID("CO23392");
- journey2.setOrigin("Amsterdam");
- journey2.setDestination("Copenhagen");
- journeys.create(journey2);
- create("example.json", journey2, journeys);
-
- Journey journey3 = new Journey();
- journey3.setJourneyID("CO23192");
- journey3.setOrigin("Amsterdam");
- journey3.setDestination("Copenhagen");
- journeys.create(journey3);
- create("example.json", journey3, journeys);
-
-// for (int i = 1; i <= 5; i++) {
-// containers.getContainers().add(new Container());
-// containers.getContainers().get(i - 1).setContainerID(i);
-// containers.getContainers().get(i - 1).setPosition("Copenhagen");
-// containers.getContainers().get(i - 1).setAvailability(true);
-// }
-//
-// Client client = new Client();
-// client.registerContainers("Copenhagen", "Fish", "Maersk", 2, containers);
-// journeys.registerTo("CO23092", "Copenhagen", "Oslo", client.getMyContainers());
-// String jsonResult = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(journeys);
-// journeys.push();
-// //Files.write(Paths.get("example.json"), jsonResult.getBytes());
-//
-// journeys.pull();
-// //journeys = mapper.readValue(new File("example.json"), JourneyDatabase.class);
-//
-// for(Journey key : journeys.getJourneys().keySet()) {
-//
-// for (Container container : journeys.getJourneys().get(key)) {
-//
-// System.out.println(container.getPosition());
-//
-// }
-//
-// }
-//
-
-
- //Files.write(Paths.get("example.json"), jsonObject.toJSONString().getBytes());
-
- }
-
- public static void create(String filename, Journey journey, JourneyDatabase journeys) throws Exception {
- ObjectMapper mapper = new ObjectMapper();
-
- ArrayList containerList = new ArrayList();
- journeys.getJourneys().put(journey, containerList);
- String jsonResult = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(journeys);
- Files.write(Paths.get(filename), jsonResult.getBytes());
- }
-
- // replaceAll("\\\\","")
- public static Object readJsonSimpleDemo(String filename) throws Exception {
- FileReader reader = new FileReader(filename);
- JSONParser jsonParser = new JSONParser();
- return jsonParser.parse(reader);
- }
-
-
-}
diff --git a/System/src/main/java/Testing.java b/System/src/main/java/Testing.java
deleted file mode 100644
index fa3b179..0000000
--- a/System/src/main/java/Testing.java
+++ /dev/null
@@ -1,75 +0,0 @@
-//import java.time.Instant;
-
-import clientsManagement.Client;
-import journeysManagement.Container;
-import journeysManagement.ContainerDatabase;
-import journeysManagement.Journey;
-import journeysManagement.JourneyDatabase;
-
-public class Testing {
-
- public static void main(String[] args) {
-
- JourneyDatabase journeys = new JourneyDatabase();
-
- try {
- journeys.produce();
- } catch (Exception e) {
-
- e.printStackTrace();
- }
-
- Journey journey = new Journey();
- String journeyID = "CO23143";
- String origin = "Copenhagen";
- String destination = "Oslo";
- journey.setJourneyID(journeyID);
- journey.setOrigin(origin);
- journey.setDestination(destination);
-
- try {
- journeys.pull();
- journeys.create(journey);
- journeys.push();
- } catch (Exception e) {
-
- e.printStackTrace();
- }
- ContainerDatabase containers = new ContainerDatabase();
- int quantity = 11;
- String location = "Copenhagen";
- String contentType = "fish";
- String company = "Banana Company";
- int temperature = 20;
- int humidity = 21;
- int pressure = 22;
-
- for (int i = 1 ; i <= quantity; i++) {
- containers.getContainers().add(new Container());
- containers.getContainers().get(i - 1).setContainerID(i);
- containers.getContainers().get(i - 1).setPosition(location);
- containers.getContainers().get(i - 1).setAvailability(true);
- containers.getContainers().get(i - 1).setTemperature(temperature);
- containers.getContainers().get(i - 1).setHumidity(humidity);
- containers.getContainers().get(i - 1).setPressure(pressure);
- containers.getContainers().get(i - 1).appendHistory();
- containers.getContainers().get(i - 1).appendHistory();
- containers.getContainers().get(i - 1).appendHistory();
- }
-
- Client client = new Client();
- client.setId(100);
- client.registerContainers(origin, contentType, company, quantity, containers);
- journeys.registerTo(journeyID, origin, destination, client.getMyContainers());
-
- try {
- journeys.push();
- journeys.pull();
- journeys.push();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
-}
diff --git a/System/src/main/java/clientsManagement/Client.java b/System/src/main/java/clientsManagement/Client.java
deleted file mode 100644
index a731ce6..0000000
--- a/System/src/main/java/clientsManagement/Client.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package clientsManagement;
-
-import java.util.ArrayList;
-import journeysManagement.Container;
-import journeysManagement.ContainerDatabase;
-import journeysManagement.ResponseObject;
-
-public class Client {
-
- private String name = null;
- private int BirthDate;
- private String email = null;
- private int PhoneNumber = 0;
- private String ReferencePerson;
- private String Address;
- private int id;
- private ArrayList myContainers = new ArrayList();
-
- public Client(String name, int BirthDate, String email, int PhoneNumber) {
- this.name= name;
- this.BirthDate = BirthDate;
- this.email = email;
- this.PhoneNumber = PhoneNumber;
- }
-
- public Client(String name, int BirthDate, int PhoneNumber) {
- this.name= name;
- this.BirthDate = BirthDate;
- this.PhoneNumber = PhoneNumber;
- }
-
- public Client(String name, int BirthDate, String email) {
- this.name= name;
- this.BirthDate = BirthDate;
- this.email = email;
- }
-
- public Client(String name, int BirthDate, String email, int PhoneNumber,String ReferencePerson , String Address) {
- this.name= name;
- this.BirthDate = BirthDate;
- this.email = email;
- this.PhoneNumber = PhoneNumber;
- this.Address = Address;
- this.ReferencePerson = ReferencePerson;
- }
-
- public Client() {
- super();
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-
- public int getBirthDate() {
- return BirthDate;
- }
- public void setBirthDate(int birthDate) {
- BirthDate = birthDate;
- }
-
-
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
-
-
- public int getPhoneNumber() {
- return PhoneNumber;
- }
- public void setPhoneNumber(int phoneNumber) {
- PhoneNumber = phoneNumber;
- }
-
-
- public String getReferencePerson() {
- return ReferencePerson;
- }
-
- public void setReferencePerson(String referencePerson) {
- ReferencePerson = referencePerson;
- }
-
-
- public String getAddress() {
- return Address;
- }
-
- public void setAddress(String address) {
- Address = address;
- }
-
-
- public String toString() {
- return "The Id is: "+ this.id +"\n"+ "The name is: "+this.name +"\n" + "this is the address" + this.Address ;
- }
-
-
- public void update(String email, int PhoneNumber,String ReferencePerson , String Address, Registery registery) {
-
- if (registery.allowedUpdate(email, PhoneNumber)) {
- this.email = email;
- this.PhoneNumber = PhoneNumber;
- this.Address = Address;
- this.ReferencePerson = ReferencePerson;
- }
-
- }
-
- public ArrayList getMyContainers() {
- return myContainers;
- }
-
- public void setMyContainers(ArrayList myContainers) {
- this.myContainers = myContainers;
- }
-
- public ResponseObject registerContainers(String location, String contentType, String company, int quantity, ContainerDatabase containers) {
-
- ResponseObject response;
-
- if (!((location == null) || (contentType == null) || (company == null) || (quantity == 0))){
-
- response = new ResponseObject(111, "Container not found");
-
- for (Container container : containers.extract(quantity, location)) {
- container.setOwner(id);
- container.setContentType(contentType);
- container.setCompany(company);
- this.myContainers.add(container);
- // Codes from 000 to 099 indicate successful operation
- response = new ResponseObject(010, "Container has been registered");
- }
-
- }
-
- else {
-
- // Codes from 100 to 999 indicate otherwise
- response = new ResponseObject(110, "Necessary parameters not entered");
-
- }
-
- return response;
-
- }
-
-}
diff --git a/System/src/main/java/clientsManagement/Registery.java b/System/src/main/java/clientsManagement/Registery.java
deleted file mode 100644
index fd84c23..0000000
--- a/System/src/main/java/clientsManagement/Registery.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package clientsManagement;
-
-
-import java.util.ArrayList;
-
-public class Registery {
- private int count = 1;
-
-
-
- private ArrayList registery = new ArrayList ();
-
-
- public void addClient(Client c) {
- if (this.checkContactInfoOfClients(c)== 0 & c.getName() != null & (c.getEmail() !=null | c.getPhoneNumber() != 0)) {
- c.setId(count);
- registery.add(c);
- count++;
-
- }else {
-
- }
-
-
- }
-
- public boolean ClientExists(Client c) {
-
- return (checkInstancesofClientinRegistery(c) == 1);
-
- }
-
- public boolean checkID(Client c) {
- int uniqueId = c.getId();
- int counter = 0;
- for (Client clients : registery) {
- if (clients.getId()==uniqueId) {
- counter ++;
- }
- }
- return (counter == 1);
- }
- //name is misleading
- public int checkContactInfoOfClients(Client c) {
- int counter = 0;
- for (Client clients : registery) {
- if (clients.getPhoneNumber()== c.getPhoneNumber() | clients.getEmail() == c.getEmail()) {
- counter ++;
- }
- }
- return (counter);
- }
- public void printer() {
- for (Client clients : registery) {
- System.out.println(clients);
- }
- }
-
- public int checkInstancesofClientinRegistery(Client c) {
- int counter = 0;
- for (Client clients : registery) {
- if (clients.getPhoneNumber()== c.getPhoneNumber() & clients.getEmail() == c.getEmail() & clients.getId() == c.getId() & clients.getBirthDate() == c.getBirthDate() & clients.getName() == c.getName() ) {
- counter ++;
- }
- }
- return (counter);
- }
-
- public boolean checkUpdatedInfo(String name, int BirthDate, String email, int PhoneNumber,String ReferencePerson , String Address) {
- for (Client clients : registery) {
- if (clients.getPhoneNumber()== PhoneNumber & clients.getEmail() == email & clients.getBirthDate() == BirthDate & clients.getName() == name & clients.getReferencePerson() == ReferencePerson & clients.getAddress() == Address) {
- return true;
- }
- }
- return (false);
-
-
- }
-
- public boolean allowedUpdate(String email, int PhoneNumber) {
- for (Client clients : registery) {
- if (clients.getPhoneNumber() == PhoneNumber ) {
- return false;
- }else if (clients.getEmail() == email){
- return false;
-
- }
- }
- return true;
- }
-
-
- public ArrayList getInfoClientbyId(int Id) {
- ArrayList listOfClientMatchingId = new ArrayList ();
- for (Client clients : registery) {
- if (clients.getId() == Id) {
- listOfClientMatchingId.add(clients);
- }
- }
- return listOfClientMatchingId;
- }
-
-
-
- public ArrayList getInfoClientbyName(String name) {
- ArrayList listOfClientMatchingName = new ArrayList ();
- for (Client clients : registery) {
- if (clients.getName() == name) {
- listOfClientMatchingName.add(clients);
- }
- }
- return listOfClientMatchingName;
- }
-}
-
-
-
-
-
-
-
diff --git a/System/src/main/java/containerStatusTracking/Class.java b/System/src/main/java/containerStatusTracking/Class.java
deleted file mode 100644
index e8856f7..0000000
--- a/System/src/main/java/containerStatusTracking/Class.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package containerStatusTracking;
-
-public class Class {
-
-}
diff --git a/System/src/main/java/controller/AddHistorycontroller.java b/System/src/main/java/controller/AddHistorycontroller.java
new file mode 100644
index 0000000..5cbeb6a
--- /dev/null
+++ b/System/src/main/java/controller/AddHistorycontroller.java
@@ -0,0 +1,97 @@
+
+package controller;
+
+import java.util.ArrayList;
+
+import javax.swing.JOptionPane;
+
+import management.Container;
+import management.LogisticsCompany;
+import view.MainMenuCompanyView;
+import view.AddHistoryView;
+import view.ContainerErrorGUI;
+import view.DisplayClientsView;
+import view.DisplayContainersView;
+//import view.DisplayJourneysView;
+public class AddHistorycontroller {
+
+ private LogisticsCompany logisticCompany;
+ private Session sessionModel;
+ private AddHistoryView view;
+
+
+ public AddHistorycontroller(LogisticsCompany logisticCompany, Session session) {
+ this.logisticCompany = logisticCompany;
+ this.sessionModel = session;
+ }
+
+ /**
+ * @param date
+ * @param id
+ * @param temp
+ * @param humid
+ * @param press
+ *
+ * this method finds the specified container, and appends the new data to its history
+ * in case of not finding the container it returns an error pop up
+ */
+ public void submitChanges(String date, int id, int temp, int humid, int press) {
+
+
+
+ ArrayList containers = new ArrayList();
+ containers = logisticCompany.getContainerDatabase().getContainers();
+
+ int count = 0;
+ for(int i = 0; i < containers.size(); i++) {
+
+
+ if (containers.get(i).getContainerID() == id) {
+
+ containers.get(i).setDate(date);
+
+ containers.get(i).setTemperature(temp);
+
+ containers.get(i).setHumidity(humid);
+
+ containers.get(i).setPressure(press);
+
+ //containers.get(i).setPosition(pos);
+ //containers.get(i).setPosition(containers.get(i).getPosition());
+
+ containers.get(i).appendHistory();
+
+ containers.get(i).setHumidity(humid);
+ count++;
+ view.setVisible(false);
+ try {
+ System.out.println("Pushing");
+ logisticCompany.getContainerDatabase().push();
+ } catch (Exception e) {
+
+ e.printStackTrace();
+ }
+
+
+
+
+ }
+ }
+ if (count == 0) {
+
+ new ContainerErrorGUI();
+
+ }
+
+ }
+
+ public void setView(AddHistoryView view) {
+ this.view = view;
+ this.view.setSession(sessionModel);
+ }
+
+ public void display() {
+ view.setVisible(true);
+ }
+
+}
\ No newline at end of file
diff --git a/System/src/main/java/controller/ApplicationController.java b/System/src/main/java/controller/ApplicationController.java
new file mode 100644
index 0000000..6c8e860
--- /dev/null
+++ b/System/src/main/java/controller/ApplicationController.java
@@ -0,0 +1,79 @@
+package controller;
+
+import java.awt.Color;
+
+import javax.swing.UIManager;
+import javax.swing.UIManager.LookAndFeelInfo;
+
+import management.Client;
+import management.ClientDatabase;
+import management.LogisticsCompany;
+
+import view.MainMenuClientView;
+import view.MainMenuCompanyView;
+
+public class ApplicationController {
+ // Attributes
+ private Client client;
+ private LogisticsCompany logisticsCompany;
+ private LoginController loginController;
+ private MainMenuClientController mainMenuClientController;
+ private MainMenuCompanyController mainMenuCompanyController;
+ private ClientDatabase clientDataBase;
+
+ // Constructor
+ public ApplicationController() {
+ logisticsCompany = LogisticsCompany.getInstance();
+ clientDataBase = logisticsCompany.getClientDatabase();
+ }
+
+ // Sends to the login page
+ public void login() {
+ loginController = new LoginController(this);
+ loginController.display();
+ }
+ // Sends to the main menu page either the company's or the client's
+ public void mainMenu(Session session){
+ if (session.getRole().equals("Company")) {
+ mainMenuCompanyController = new MainMenuCompanyController(this.logisticsCompany, session);
+
+ MainMenuCompanyView mainMenuView = new MainMenuCompanyView(this.mainMenuCompanyController);
+ mainMenuCompanyController.setView(mainMenuView);
+ mainMenuCompanyController.display();
+ }
+
+ else {
+ this.client = clientDataBase.getClient(session.getUsername()).get(0);
+ mainMenuClientController = new MainMenuClientController(this.client, this.logisticsCompany, session);
+
+ MainMenuClientView mainMenuView = new MainMenuClientView(this.mainMenuClientController);
+ mainMenuClientController.setView(mainMenuView);
+ mainMenuClientController.display();
+ }
+
+ }
+
+
+ // Getter
+ public ClientDatabase getclientdatabase() {
+ return this.clientDataBase;
+ }
+
+ // main
+ public static void main(String[] args) {
+ try {
+ for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ UIManager.setLookAndFeel(info.getClassName());
+ UIManager.put("control", new Color(255,255,255));
+ UIManager.put("nimbusBlueGrey", new Color(115,164,209));
+ break;
+ }
+ }
+ } catch (Exception e) {
+ }
+ ApplicationController app = new ApplicationController();
+ app.login();
+ }
+
+}
diff --git a/System/src/main/java/controller/ClientPersonalInfoController.java b/System/src/main/java/controller/ClientPersonalInfoController.java
new file mode 100644
index 0000000..47b7108
--- /dev/null
+++ b/System/src/main/java/controller/ClientPersonalInfoController.java
@@ -0,0 +1,80 @@
+package controller;
+
+
+
+import java.util.regex.Pattern;
+
+import javax.swing.JOptionPane;
+
+import management.Client;
+
+
+import management.LogisticsCompany;
+import view.ClientPersonalInfoView;
+
+
+
+public class ClientPersonalInfoController {
+
+ //Attributes
+ private Session sessionModel;
+ private ClientPersonalInfoView view;
+ private Client client;
+ private LogisticsCompany company;
+
+ //Constructor
+ public ClientPersonalInfoController(Client client, Session session, LogisticsCompany company) {
+ this.client = client;
+ this.company = company;
+ this.sessionModel = session;
+ }
+
+
+ //Setter
+ public void setView(ClientPersonalInfoView view) {
+ this.view = view;
+ this.view.setSession(sessionModel);
+ }
+
+
+ //Method used to check for right format and gets access to the model (Client class) in order to update personal information
+ public void updateInfo(String FirstName, String LastName, String BirthDate, String Email, String PhoneNumber, String password ) throws Exception {
+// boolean birthdayFormatChecker = Pattern.matches("([0-9]{2})\\\\([0-9]{2})\\\\([0-9]{4})", BirthDate);
+ boolean birthdayFormatChecker = Pattern.matches("^((3[0-1]|2[0-9]|1[0-9]|[1-9])/(1[0-2]|0[1-9])/([0-9]{4}))$", BirthDate);
+ boolean emailFormatChecker = Pattern.matches("^(.+)@(.+)$", Email);
+ boolean phoneFormatChecker = Pattern.matches("([0-9]{8,}+)", PhoneNumber);
+ boolean nameFormatChecker = Pattern.matches("^[^\\d\\s]+$",FirstName) & Pattern.matches("^[^\\d\\s]+$",LastName);
+ boolean passwordFormatChecker = Pattern.matches("^[^\\s]+$",password);
+ if (birthdayFormatChecker & emailFormatChecker & phoneFormatChecker& nameFormatChecker& passwordFormatChecker) {
+ String errorMessage = client.updateInfo(FirstName, LastName, BirthDate, Email, PhoneNumber, company.getClientDatabase()).getErrorMessage();
+ client.updateInfo(password, company.getClientDatabase());
+ view.showError(errorMessage);
+ }
+ else if(!birthdayFormatChecker) {
+ view.showError("Incorrect birth date format! It has to follow the following format DD/MM/YYYY");
+ }else if(!emailFormatChecker) {
+ view.showError("Incorrect email format! It has to follow the following XXXXX@XXXX.XXX");
+ }else if(!phoneFormatChecker) {
+ view.showError("Incorrect phone format! It has to be composed of at least 8 numbers with no other characters");
+ }else if(!nameFormatChecker) {
+ view.showError("Incorrect name format! Numbers and white spaces are not allowed");
+ }else if(!passwordFormatChecker) {
+ view.showError("Incorrect password format! No white space is allowed");
+ }else {
+ view.showError("ERROR ERROR!! DOWNLOADING VIRUS!!!");
+ }
+
+
+ }
+ //Displays the personal information page for client
+ public void display() {
+ view.setVisible(true);
+ }
+ //getter
+ public Client getClient() {
+ return this.client;
+ }
+
+
+}
+
diff --git a/System/src/main/java/controller/CompanyPersonalInfoController.java b/System/src/main/java/controller/CompanyPersonalInfoController.java
new file mode 100644
index 0000000..99f3201
--- /dev/null
+++ b/System/src/main/java/controller/CompanyPersonalInfoController.java
@@ -0,0 +1,84 @@
+package controller;
+
+import java.util.regex.*;
+import management.Client;
+
+import management.LogisticsCompany;
+import response.ResponseObject;
+import view.CompanyPersonalInfoView;
+import view.DisplayClientsView;
+
+
+
+
+ public class CompanyPersonalInfoController {
+ //Attributes
+ private Session sessionModel;
+ private CompanyPersonalInfoView view;
+
+ private LogisticsCompany company;
+ //Constructor
+ public CompanyPersonalInfoController( Session session, LogisticsCompany company) {
+
+ this.company =company;
+ this.sessionModel = session;
+ }
+ //setter
+ public void setView(CompanyPersonalInfoView view) {
+ this.view = view;
+ this.view.setSession(sessionModel);
+ }
+ //Method used to check for right fomat and gets access to the model (LogisticsCompany class) in order to register a client
+ public void createInfo(String FirstName, String LastName, String BirthDate, String Email, String PhoneNumber, String password ) throws Exception {
+// boolean birthdayFormatChecker = Pattern.matches("([0-9]{2})/([0-9]{2})/([0-9]{4})", BirthDate);
+ boolean birthdayFormatChecker = Pattern.matches("^((3[0-1]|2[0-9]|1[0-9]|[1-9])/(1[0-2]|0[1-9])/([0-9]{4}))$", BirthDate);
+ boolean EmailFormatChecker = Pattern.matches("^(.+)@(.+)$", Email);
+ boolean phoneFormatChecker = Pattern.matches("([0-9]{8,}+)", PhoneNumber);
+ boolean nameFormatChecker = Pattern.matches("^[^\\d\\s]+$",FirstName) & Pattern.matches("^[^\\d\\s]+$",LastName);
+ boolean passwordFormatChecker = Pattern.matches("^[^\\s]+$",password);
+
+ if (birthdayFormatChecker & EmailFormatChecker & phoneFormatChecker& nameFormatChecker& passwordFormatChecker) {
+ Client client = new Client(FirstName, LastName, BirthDate, Email, PhoneNumber, password);
+ ResponseObject result = company.CreateNewClient(client);
+ if (result.getErrorCode() == 1000) {
+ view.setVisible(false);
+ view.showError(result.getErrorMessage());
+
+ DisplayClientsController displayClientsController = new DisplayClientsController(this.company, this.sessionModel);
+
+ DisplayClientsView invView = new DisplayClientsView(displayClientsController);
+ displayClientsController.setView(invView);
+ displayClientsController.display();
+ } else {
+ view.showError(result.getErrorMessage());
+ }
+ }else if(!birthdayFormatChecker) {
+ view.showError("Incorrect birth date format! It has to follow the following format DD/MM/YYYY");
+ }else if(!EmailFormatChecker) {
+ view.showError("Incorrect email format! It has to follow the following XXXXX@XXXX.XXX");
+ }else if(!phoneFormatChecker) {
+ view.showError("Incorrect phone format! It has to be composed of at least 8 numbers with no other characters");
+ }else if(!nameFormatChecker) {
+ view.showError("Incorrect name format! Numbers and white spaces are not allowed");
+ }else if(!passwordFormatChecker) {
+ view.showError("Incorrect password format! No white space is allowed");
+ }else {
+ view.showError("ERROR ERROR!! DOWNLOADING VIRUS!!!");
+ }
+
+
+ }
+
+
+ //Display the company personal information page
+
+ public void display() {
+ view.setVisible(true);
+ }
+
+
+ }
+
+
+
+
diff --git a/System/src/main/java/controller/DisplayClientsController.java b/System/src/main/java/controller/DisplayClientsController.java
new file mode 100644
index 0000000..bd41713
--- /dev/null
+++ b/System/src/main/java/controller/DisplayClientsController.java
@@ -0,0 +1,92 @@
+package controller;
+
+
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+import javax.swing.SwingUtilities;
+
+import management.LogisticsCompany;
+import management.ClientDatabase;
+import view.CompanyPersonalInfoView;
+import view.DisplayClientsView;
+
+public class DisplayClientsController {
+ //Attributes
+ private LogisticsCompany logisticCompany;
+ private Session sessionModel;
+ private DisplayClientsView view;
+ private JTextField id = new JTextField();
+ private JTextField email = new JTextField();
+
+ private ClientDatabase registery = new ClientDatabase();
+ Object [] fields = {
+ "ID", id,
+ "Email", email,
+
+
+ };
+ //Constructor
+ public DisplayClientsController(LogisticsCompany logisticCompany, Session session) {
+ registery.setClients(logisticCompany.getClientDatabase().getClients());
+ this.sessionModel = session;
+ this.logisticCompany = logisticCompany;
+ }
+ //Filters the table based on some criteria (id or email)
+ public void filter() {
+ int response = JOptionPane.showConfirmDialog(null, fields, "Enter relevant search criteria", JOptionPane.OK_CANCEL_OPTION);
+
+ String id = this.id.getText();
+ String email = this.email.getText();
+
+
+ if (response==0) {
+
+ registery.setClients(logisticCompany.getClientDatabase().getClients());
+
+ if (!id.equals("") && id!=null) {
+ registery.setClients((registery.getClient(Integer.parseInt(id))));
+ SwingUtilities.updateComponentTreeUI(view);
+
+ }
+
+ if (!email.equals("") && email!=null) {
+ registery.setClients((registery.getClient(email)));
+ SwingUtilities.updateComponentTreeUI(view);
+
+
+ }
+
+ }}
+
+
+ //Sends to create client page
+ public void addClient() {
+ view.setVisible(false);
+
+ CompanyPersonalInfoController companyInfoController = new CompanyPersonalInfoController(this.sessionModel,logisticCompany);
+
+ CompanyPersonalInfoView companyView = new CompanyPersonalInfoView(companyInfoController);
+ companyInfoController.setView(companyView);
+ companyInfoController.display();
+
+
+ }
+ //Setter
+ public void setView(DisplayClientsView view) {
+ this.view = view;
+ this.view.setTableModel(registery);
+ this.view.setSession(sessionModel);
+ }
+ //Refreshes the table so you cancel the filter
+ public void refresh() {
+ registery.setClients(logisticCompany.getClientDatabase().getClients());
+ SwingUtilities.updateComponentTreeUI(view);
+
+
+ }
+ //Displays the display client page
+ public void display() {
+ view.setVisible(true);
+ }
+
+}
diff --git a/System/src/main/java/controller/DisplayContainersController.java b/System/src/main/java/controller/DisplayContainersController.java
new file mode 100644
index 0000000..45a7430
--- /dev/null
+++ b/System/src/main/java/controller/DisplayContainersController.java
@@ -0,0 +1,125 @@
+
+package controller;
+
+import javax.swing.JComboBox;
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+
+import management.ContainerDatabase;
+import management.LogisticsCompany;
+import view.DisplayContainersView;
+
+public class DisplayContainersController {
+
+ private LogisticsCompany logisticCompany;
+ private Session sessionModel;
+ private DisplayContainersView view;
+ private ContainerDatabase registry = new ContainerDatabase();
+ private JTextField id = new JTextField();
+ private JTextField owner = new JTextField();
+ private JTextField position = new JTextField();
+ private JTextField contentType = new JTextField();
+ private JTextField company = new JTextField();
+ private Boolean comboBoxItems[] = {null, Boolean.TRUE, Boolean.FALSE};
+ private JComboBox