File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
src/main/kotlin/application/controller/manager Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2023. Smart Operating Block
3
+ *
4
+ * Use of this source code is governed by an MIT-style
5
+ * license that can be found in the LICENSE file or at
6
+ * https://opensource.org/licenses/MIT.
7
+ */
8
+
9
+ package application.controller.manager
10
+
11
+ import entity.zone.Room
12
+ import entity.zone.RoomID
13
+ import java.util.Date
14
+
15
+ /* *
16
+ * This interface models the manager of the database for rooms.
17
+ * In this way it is independent respect to the specific technology that is used,
18
+ * having the only semantic dependency on the concept of db.
19
+ */
20
+ interface RoomDatabaseManager {
21
+ /* *
22
+ * Save a [room] inside the DB.
23
+ * @return true if successfully stored, false otherwise.
24
+ */
25
+ fun saveRoom (room : Room ): Boolean
26
+
27
+ /* *
28
+ * Delete a room identified by its [roomId] from the DB.
29
+ * @return true if successfully deleted, false otherwise.
30
+ */
31
+ fun deleteRoom (roomId : RoomID ): Boolean
32
+
33
+ /* *
34
+ * Get a room identified by its [roomId] from the DB.
35
+ * Specify a past [dateTime] in order to get historical data.
36
+ * @return null if data is not available, the room instead.
37
+ */
38
+ fun findBy (roomId : RoomID , dateTime : Date ): Room ?
39
+ }
You can’t perform that action at this time.
0 commit comments