refactor: Renamed `ChatRoom` into `ChatRoomData` - Aligned Code
authorKai Moritz <kai@juplo.de>
Mon, 4 Sep 2023 19:14:12 +0000 (21:14 +0200)
committerKai Moritz <kai@juplo.de>
Mon, 4 Sep 2023 19:14:12 +0000 (21:14 +0200)
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatRoomChannel.java
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHome.java

index b631ed5..257c6db 100644 (file)
@@ -362,7 +362,7 @@ public class ChatRoomChannel implements Runnable, ConsumerRebalanceListener
         .toArray();
   }
 
-  Mono<ChatRoomData> getChatRoom(int shard, UUID id)
+  Mono<ChatRoomData> getChatRoomData(int shard, UUID id)
   {
     if (loadInProgress)
     {
@@ -377,7 +377,7 @@ public class ChatRoomChannel implements Runnable, ConsumerRebalanceListener
     return Mono.justOrEmpty(chatrooms[shard].get(id));
   }
 
-  Flux<ChatRoomData> getChatRooms()
+  Flux<ChatRoomData> getChatRoomData()
   {
     return Flux
         .fromStream(IntStream.range(0, numShards).mapToObj(i -> Integer.valueOf(i)))
index cea178b..c2e95d4 100644 (file)
@@ -34,7 +34,7 @@ public class KafkaChatHome implements ChatHome
   {
     int shard = selectShard(id);
     return chatRoomChannel
-        .getChatRoom(shard, id)
+        .getChatRoomData(shard, id)
         .switchIfEmpty(Mono.error(() -> new UnknownChatroomException(
             id,
             shard,
@@ -44,7 +44,7 @@ public class KafkaChatHome implements ChatHome
   @Override
   public Flux<ChatRoomInfo> getChatRoomInfo()
   {
-    return chatRoomChannel.getChatRooms();
+    return chatRoomChannel.getChatRoomData();
   }
 
   @Override
@@ -52,7 +52,7 @@ public class KafkaChatHome implements ChatHome
   {
     int shard = selectShard(id);
     return chatRoomChannel
-        .getChatRoom(shard, id)
+        .getChatRoomData(shard, id)
         .switchIfEmpty(Mono.error(() -> new UnknownChatroomException(
             id,
             shard,
@@ -62,7 +62,7 @@ public class KafkaChatHome implements ChatHome
   @Override
   public Flux<ChatRoomData> getChatRoomData()
   {
-      return chatRoomChannel.getChatRooms();
+      return chatRoomChannel.getChatRoomData();
   }
 
   int selectShard(UUID chatRoomId)