{
Mono<ChatRoom> getChatRoom(UUID id);
- Flux<ChatRoomInfo> getChatRooms();
+ Flux<ChatRoom> getChatRooms();
}
public interface ChatHomeService
{
Mono<ChatRoom> getChatRoom(int shard, UUID id);
- Flux<ChatRoomInfo> getChatRooms(int shard);
+ Flux<ChatRoom> getChatRooms(int shard);
}
}
@Override
- public Flux<ChatRoomInfo> getChatRooms()
+ public Flux<ChatRoom> getChatRooms()
{
return Flux
.fromIterable(ownedShards)
}
@Override
- public Flux<ChatRoomInfo> getChatRooms()
+ public Flux<ChatRoom> getChatRooms()
{
return service.getChatRooms(shard);
}
}
@Override
- public Flux<ChatRoomInfo> getChatRooms(int shard)
+ public Flux<ChatRoom> getChatRooms(int shard)
{
return Flux.fromStream(chatrooms[shard].values().stream());
}
{
private final String topic;
private final Consumer<String, AbstractTo> consumer;
- private final Map<UUID, ChatRoomInfo> chatrooms = new HashMap<>();
+ private final Map<UUID, ChatRoom> chatrooms = new HashMap<>();
private boolean running;
chatrooms.put(chatRoomInfo.getId(), chatRoomInfo);
}
- Flux<ChatRoomInfo> getChatRooms()
+ Flux<ChatRoom> getChatRooms()
{
return Flux.fromIterable(chatrooms.values());
}
}
@Override
- public Flux<ChatRoomInfo> getChatRooms()
+ public Flux<ChatRoom> getChatRooms()
{
return chatRoomChannel.getChatRooms();
}
void persistMessage(Message message)
{
- messages.put(message.getKey(), message);
+ messages.put (message.getKey(), message);
}
@Override