NG
authorKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 13:55:57 +0000 (15:55 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 15:18:41 +0000 (17:18 +0200)
src/main/java/de/juplo/kafka/chat/backend/domain/ChatHome.java
src/main/java/de/juplo/kafka/chat/backend/domain/ChatHomeService.java
src/main/java/de/juplo/kafka/chat/backend/domain/ShardedChatHome.java
src/main/java/de/juplo/kafka/chat/backend/domain/SimpleChatHome.java
src/main/java/de/juplo/kafka/chat/backend/persistence/inmemory/InMemoryChatHomeService.java
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatRoomService.java

index 15d542a..6091c0c 100644 (file)
@@ -10,5 +10,5 @@ public interface ChatHome
 {
   Mono<ChatRoom> getChatRoom(UUID id);
 
-  Flux<ChatRoomInfo> getChatRooms();
+  Flux<ChatRoom> getChatRooms();
 }
index 9becd6e..19ff4aa 100644 (file)
@@ -9,5 +9,5 @@ import java.util.UUID;
 public interface ChatHomeService
 {
   Mono<ChatRoom> getChatRoom(int shard, UUID id);
-  Flux<ChatRoomInfo> getChatRooms(int shard);
+  Flux<ChatRoom> getChatRooms(int shard);
 }
index 69527f6..6d2f079 100644 (file)
@@ -47,7 +47,7 @@ public class ShardedChatHome implements ChatHome
   }
 
   @Override
-  public Flux<ChatRoomInfo> getChatRooms()
+  public Flux<ChatRoom> getChatRooms()
   {
     return Flux
         .fromIterable(ownedShards)
index 90061e6..11542ed 100644 (file)
@@ -36,7 +36,7 @@ public class SimpleChatHome implements ChatHome
   }
 
   @Override
-  public Flux<ChatRoomInfo> getChatRooms()
+  public Flux<ChatRoom> getChatRooms()
   {
     return service.getChatRooms(shard);
   }
index 0f0c952..8eaaccc 100644 (file)
@@ -64,7 +64,7 @@ public class InMemoryChatHomeService implements ChatHomeService
   }
 
   @Override
-  public Flux<ChatRoomInfo> getChatRooms(int shard)
+  public Flux<ChatRoom> getChatRooms(int shard)
   {
     return Flux.fromStream(chatrooms[shard].values().stream());
   }
index 1c6ae91..5d3f862 100644 (file)
@@ -27,7 +27,7 @@ public class ChatRoomChannel implements Runnable
 {
   private final String topic;
   private final Consumer<String, AbstractTo> consumer;
-  private final Map<UUID, ChatRoomInfo> chatrooms = new HashMap<>();
+  private final Map<UUID, ChatRoom> chatrooms = new HashMap<>();
 
   private boolean running;
 
@@ -80,7 +80,7 @@ public class ChatRoomChannel implements Runnable
     chatrooms.put(chatRoomInfo.getId(), chatRoomInfo);
   }
 
-  Flux<ChatRoomInfo> getChatRooms()
+  Flux<ChatRoom> getChatRooms()
   {
     return Flux.fromIterable(chatrooms.values());
   }
index bf99dbf..2bccc3a 100644 (file)
@@ -36,7 +36,7 @@ public class KafkaChatHome implements ChatHome
   }
 
   @Override
-  public Flux<ChatRoomInfo> getChatRooms()
+  public Flux<ChatRoom> getChatRooms()
   {
       return chatRoomChannel.getChatRooms();
   }
index f802234..77ecf1c 100644 (file)
@@ -34,7 +34,7 @@ public class KafkaChatRoomService implements ChatRoomService
 
   void persistMessage(Message message)
   {
-    messages.put(message.getKey(), message);
+    messages.put  (message.getKey(), message);
   }
 
   @Override