@RequiredArgsConstructor
-public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryPersistenceStrategy>
+public class InMemoryChatroomFactory implements ChatroomFactory<InMemoryChatroomService>
{
private final int bufferSize;
@Override
public Chatroom createChatroom(UUID id, String name)
{
- InMemoryPersistenceStrategy persistenceStrategy =
- new InMemoryPersistenceStrategy(new LinkedHashMap<>());
- return new Chatroom(id, name, persistenceStrategy, bufferSize);
+ InMemoryChatroomService chatroomService =
+ new InMemoryChatroomService(new LinkedHashMap<>());
+ return new Chatroom(id, name, chatroomService, bufferSize);
}
- @Override
public Chatroom restoreChatroom(
UUID id,
String name,
- InMemoryPersistenceStrategy persistenceStrategy)
+ InMemoryChatroomService chatroomService)
{
- return new Chatroom(id, name, persistenceStrategy, bufferSize);
+ return new Chatroom(id, name, chatroomService, bufferSize);
}
}