generated from SmartOperatingBlock/kotlin-template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: check on presence of mongo connection string
- Loading branch information
1 parent
8523d9e
commit 724b603
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
src/main/kotlin/infrastructure/database/DatabaseManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Room> { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
companion object { | ||
private const val mongodbConnectionStringVariable = "MONGODB_CONNECTION_STRING" | ||
// private const val databaseName = "building_management" | ||
// private const val roomCollectionName = "rooms" | ||
} | ||
} |