feat: first runnable implementation, that is based on Kafka
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / persistence / inmemory / InMemoryChatHomeService.java
index 87fa61f..1334124 100644 (file)
@@ -1,7 +1,6 @@
 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 lombok.extern.slf4j.Slf4j;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
@@ -10,7 +9,7 @@ import java.util.*;
 
 
 @Slf4j
-public class InMemoryChatHomeService implements ChatHomeService<InMemoryChatRoomService>
+public class InMemoryChatHomeService
 {
   private final Map<UUID, ChatRoom>[] chatrooms;
 
@@ -51,20 +50,16 @@ public class InMemoryChatHomeService implements ChatHomeService<InMemoryChatRoom
         .forEach(chatroom -> chatrooms[chatroom.getShard()].put(chatroom.getId(), chatroom));
   }
 
-  @Override
-  public Mono<ChatRoom> putChatRoom(ChatRoom chatRoom)
+  public void putChatRoom(ChatRoom chatRoom)
   {
     chatrooms[chatRoom.getShard()].put(chatRoom.getId(), chatRoom);
-    return Mono.just(chatRoom);
   }
 
-  @Override
   public Mono<ChatRoom> getChatRoom(int shard, UUID id)
   {
     return Mono.justOrEmpty(chatrooms[shard].get(id));
   }
 
-  @Override
   public Flux<ChatRoom> getChatRooms(int shard)
   {
     return Flux.fromStream(chatrooms[shard].values().stream());