refactor: Moved extracted the `subscribe()`-call from `StorageStrategy`
authorKai Moritz <kai@juplo.de>
Mon, 19 Feb 2024 14:01:58 +0000 (15:01 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 20 Feb 2024 14:27:40 +0000 (15:27 +0100)
commit1ce142cb9566a9ab5eacb3d1da7f414722e994e9
tree7394921b84c100745731c1f497ac63642560546f
parentc786c4a079da27f54e75d22e2d2c2a1693aba078
refactor: Moved extracted the `subscribe()`-call from `StorageStrategy`

* The subscription does no more happen inside the implementations of the
  interface `StorageStrategy`.
* Instead, the methods, that are defined in `StorageStrategy` return the
  created `Flux`.
* The call to `subscribe()` happens in the code, that uses this methods.
* This faciliates feature refinements concerning the asynchronous handling
  of success- and error-cases and so forth.
src/main/java/de/juplo/kafka/chat/backend/ChatBackendApplication.java
src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java
src/main/java/de/juplo/kafka/chat/backend/implementation/StorageStrategy.java
src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/ChatRoomTo.java
src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageStrategy.java
src/main/java/de/juplo/kafka/chat/backend/storage/nostorage/NoStorageStorageStrategy.java
src/test/java/de/juplo/kafka/chat/backend/AbstractStorageStrategyIT.java