From 724b6036a4b9ed8572b16b4885f1756eb6811100 Mon Sep 17 00:00:00 2001 From: Andrea Giulianelli Date: Thu, 23 Feb 2023 12:09:37 +0100 Subject: [PATCH] chore: check on presence of mongo connection string --- .../database/DatabaseManager.kt | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/kotlin/infrastructure/database/DatabaseManager.kt diff --git a/src/main/kotlin/infrastructure/database/DatabaseManager.kt b/src/main/kotlin/infrastructure/database/DatabaseManager.kt new file mode 100644 index 00000000..b223aa1c --- /dev/null +++ b/src/main/kotlin/infrastructure/database/DatabaseManager.kt @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023. Smart Operating Block + * + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. + */ + +package infrastructure.database + +import application.controller.manager.RoomDatabaseManager +import entity.zone.Room +import entity.zone.RoomID +import java.util.Date + +/** + * Implementation of the room database manager. + */ +class DatabaseManager : RoomDatabaseManager { + init { + checkNotNull(System.getenv(mongodbConnectionStringVariable)) { "mongodb connection string required" } + } + +// private val database = KMongo +// .createClient(System.getenv(mongodbConnectionStringVariable)) +// .getDatabase(databaseName) + + override fun saveRoom(room: Room): Boolean { + TODO("Not yet implemented") + } + + override fun deleteRoom(roomId: RoomID): Boolean { + TODO("Not yet implemented") + } + + override fun findBy(roomId: RoomID, dateTime: Date): Room? { + TODO("Not yet implemented") + } + + override fun getAllRooms(): Set { + TODO("Not yet implemented") + } + + companion object { + private const val mongodbConnectionStringVariable = "MONGODB_CONNECTION_STRING" +// private const val databaseName = "building_management" +// private const val roomCollectionName = "rooms" + } +}