refactore: Renamed `ChatroomFactory` to `ChatHomeService` -- Move
authorKai Moritz <kai@juplo.de>
Sun, 8 Jan 2023 09:17:34 +0000 (10:17 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:35:59 +0000 (19:35 +0100)
src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java [new file with mode: 0644]
src/main/java/de/juplo/kafka/chat/backend/domain/ChatroomFactory.java [deleted file]
src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatHomeService.java [new file with mode: 0644]
src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatroomFactory.java [deleted file]

diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java
new file mode 100644 (file)
index 0000000..e1236b9
--- /dev/null
@@ -0,0 +1,9 @@
+package de.juplo.kafka.chat.backend.domain;
+
+import java.util.UUID;
+
+
+public interface ChatroomFactory<T extends ChatroomService>
+{
+  Chatroom createChatroom(UUID id, String name);
+}
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
deleted file mode 100644 (file)
index e1236b9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package de.juplo.kafka.chat.backend.domain;
-
-import java.util.UUID;
-
-
-public interface ChatroomFactory<T extends ChatroomService>
-{
-  Chatroom createChatroom(UUID id, String name);
-}
diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatHomeService.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/InMemoryChatHomeService.java
new file mode 100644 (file)
index 0000000..41ecd4c
--- /dev/null
@@ -0,0 +1,32 @@
+package de.juplo.kafka.chat.backend.persistence;
+
+import de.juplo.kafka.chat.backend.domain.Chatroom;
+import de.juplo.kafka.chat.backend.domain.ChatroomFactory;
+import lombok.RequiredArgsConstructor;
+
+import java.util.LinkedHashMap;
+import java.util.UUID;
+
+
+@RequiredArgsConstructor
+public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryChatroomService>
+{
+  private final int bufferSize;
+
+
+  @Override
+  public Chatroom createChatroom(UUID id, String name)
+  {
+    InMemoryChatroomService chatroomService =
+        new InMemoryChatroomService(new LinkedHashMap<>());
+    return new Chatroom(id, name, chatroomService, bufferSize);
+  }
+
+  public Chatroom restoreChatroom(
+      UUID id,
+      String name,
+      InMemoryChatroomService chatroomService)
+  {
+    return new Chatroom(id, name, chatroomService, bufferSize);
+  }
+}
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
deleted file mode 100644 (file)
index 41ecd4c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package de.juplo.kafka.chat.backend.persistence;
-
-import de.juplo.kafka.chat.backend.domain.Chatroom;
-import de.juplo.kafka.chat.backend.domain.ChatroomFactory;
-import lombok.RequiredArgsConstructor;
-
-import java.util.LinkedHashMap;
-import java.util.UUID;
-
-
-@RequiredArgsConstructor
-public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryChatroomService>
-{
-  private final int bufferSize;
-
-
-  @Override
-  public Chatroom createChatroom(UUID id, String name)
-  {
-    InMemoryChatroomService chatroomService =
-        new InMemoryChatroomService(new LinkedHashMap<>());
-    return new Chatroom(id, name, chatroomService, bufferSize);
-  }
-
-  public Chatroom restoreChatroom(
-      UUID id,
-      String name,
-      InMemoryChatroomService chatroomService)
-  {
-    return new Chatroom(id, name, chatroomService, bufferSize);
-  }
-}