Skip to content

Commit

Permalink
chore: check on presence of mongo connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGiulianelli committed Mar 7, 2023
1 parent 8523d9e commit 724b603
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/main/kotlin/infrastructure/database/DatabaseManager.kt
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"
}
}

0 comments on commit 724b603

Please sign in to comment.