NG
authorKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 12:37:33 +0000 (14:37 +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/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/KafkaChatHome.java

index 19ff4aa..9becd6e 100644 (file)
@@ -9,5 +9,5 @@ import java.util.UUID;
 public interface ChatHomeService
 {
   Mono<ChatRoom> getChatRoom(int shard, UUID id);
-  Flux<ChatRoom> getChatRooms(int shard);
+  Flux<ChatRoomInfo> getChatRooms(int shard);
 }
index 6d2f079..69527f6 100644 (file)
@@ -47,7 +47,7 @@ public class ShardedChatHome implements ChatHome
   }
 
   @Override
-  public Flux<ChatRoom> getChatRooms()
+  public Flux<ChatRoomInfo> getChatRooms()
   {
     return Flux
         .fromIterable(ownedShards)
index 11542ed..90061e6 100644 (file)
@@ -36,7 +36,7 @@ public class SimpleChatHome implements ChatHome
   }
 
   @Override
-  public Flux<ChatRoom> getChatRooms()
+  public Flux<ChatRoomInfo> getChatRooms()
   {
     return service.getChatRooms(shard);
   }
index 8f262a0..0f0c952 100644 (file)
@@ -2,6 +2,7 @@ package de.juplo.kafka.chat.backend.persistence.inmemory;
 
 import de.juplo.kafka.chat.backend.domain.ChatRoom;
 import de.juplo.kafka.chat.backend.domain.ChatHomeService;
+import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
 import lombok.extern.slf4j.Slf4j;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
@@ -63,7 +64,7 @@ public class InMemoryChatHomeService implements ChatHomeService
   }
 
   @Override
-  public Flux<ChatRoom> getChatRooms(int shard)
+  public Flux<ChatRoomInfo> getChatRooms(int shard)
   {
     return Flux.fromStream(chatrooms[shard].values().stream());
   }
index ac87aac..bf99dbf 100644 (file)
@@ -2,6 +2,7 @@ package de.juplo.kafka.chat.backend.persistence.kafka;
 
 import de.juplo.kafka.chat.backend.domain.ChatHome;
 import de.juplo.kafka.chat.backend.domain.ChatRoom;
+import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
 import de.juplo.kafka.chat.backend.domain.ShardingStrategy;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;