refactore: Renamed `PersistenceStrategy` to `ChatroomService` -- Rename
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / persistence / InMemoryChatroomFactory.java
index a405be9..41ecd4c 100644 (file)
@@ -9,7 +9,7 @@ import java.util.UUID;
 
 
 @RequiredArgsConstructor
-public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryPersistenceStrategy>
+public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryChatroomService>
 {
   private final int bufferSize;
 
@@ -17,17 +17,16 @@ public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryPersiste
   @Override
   public Chatroom createChatroom(UUID id, String name)
   {
-    InMemoryPersistenceStrategy persistenceStrategy =
-        new InMemoryPersistenceStrategy(new LinkedHashMap<>());
-    return new Chatroom(id, name, persistenceStrategy, bufferSize);
+    InMemoryChatroomService chatroomService =
+        new InMemoryChatroomService(new LinkedHashMap<>());
+    return new Chatroom(id, name, chatroomService, bufferSize);
   }
 
-  @Override
   public Chatroom restoreChatroom(
       UUID id,
       String name,
-      InMemoryPersistenceStrategy persistenceStrategy)
+      InMemoryChatroomService chatroomService)
   {
-    return new Chatroom(id, name, persistenceStrategy, bufferSize);
+    return new Chatroom(id, name, chatroomService, bufferSize);
   }
 }