From: Kai Moritz Date: Sun, 8 Jan 2023 08:53:03 +0000 (+0100) Subject: refactor: Only `LocalJsonFileStorageStrategy` restores `Chatroom`s X-Git-Tag: TEST~46 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=590ed0c8d47a021fd675dfeb2805c738a21a854c;p=demos%2Fkafka%2Fchat refactor: Only `LocalJsonFileStorageStrategy` restores `Chatroom`s --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendConfiguration.java b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendConfiguration.java index b590854e..b9d1d29c 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/ChatBackendConfiguration.java +++ b/src/main/java/de/juplo/kafka/chat/backend/ChatBackendConfiguration.java @@ -30,7 +30,7 @@ public class ChatBackendConfiguration public StorageStrategy storageStrategy( ChatBackendProperties properties, ObjectMapper mapper, - ChatroomFactory chatroomFactory) + InMemoryChatroomFactory chatroomFactory) { return new LocalJsonFilesStorageStrategy( Paths.get(properties.getDatadir()), @@ -39,7 +39,7 @@ public class ChatBackendConfiguration } @Bean - ChatroomFactory chatroomFactory(ChatBackendProperties properties) + InMemoryChatroomFactory chatroomFactory(ChatBackendProperties properties) { return new InMemoryChatroomFactory(properties.getChatroomBufferSize()); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatroomFactory.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatroomFactory.java index f5e8c19b..6e770958 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatroomFactory.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatroomFactory.java @@ -6,5 +6,4 @@ import java.util.UUID; public interface ChatroomFactory { Chatroom createChatroom(UUID id, String name); - Chatroom restoreChatroom(UUID id, String name, Strategy strategy); } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatroomFactory.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatroomFactory.java index a405be9e..6e4985ed 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatroomFactory.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatroomFactory.java @@ -22,7 +22,6 @@ public class InMemoryChatroomFactory implements ChatroomFactory