public StorageStrategy storageStrategy(
ChatBackendProperties properties,
ObjectMapper mapper,
- ChatroomFactory chatroomFactory)
+ InMemoryChatroomFactory chatroomFactory)
{
return new LocalJsonFilesStorageStrategy(
Paths.get(properties.getDatadir()),
}
@Bean
- ChatroomFactory chatroomFactory(ChatBackendProperties properties)
+ InMemoryChatroomFactory chatroomFactory(ChatBackendProperties properties)
{
return new InMemoryChatroomFactory(properties.getChatroomBufferSize());
}
public interface ChatroomFactory<Strategy extends PersistenceStrategy>
{
Chatroom createChatroom(UUID id, String name);
- Chatroom restoreChatroom(UUID id, String name, Strategy strategy);
}
return new Chatroom(id, name, persistenceStrategy, bufferSize);
}
- @Override
public Chatroom restoreChatroom(
UUID id,
String name,
import de.juplo.kafka.chat.backend.api.ChatroomTo;
import de.juplo.kafka.chat.backend.api.MessageTo;
import de.juplo.kafka.chat.backend.domain.Chatroom;
-import de.juplo.kafka.chat.backend.domain.ChatroomFactory;
import de.juplo.kafka.chat.backend.domain.Message;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
private final Path storagePath;
private final ObjectMapper mapper;
- private final ChatroomFactory chatroomFactory;
+ private final InMemoryChatroomFactory chatroomFactory;
@Override