import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
-import java.util.Arrays;
import java.util.UUID;
private final ChatHome chatHome;
private final ChatRoomFactory factory;
private final StorageStrategy storageStrategy;
- private final int[] ownedShards;
@PostMapping("create")
}
- @GetMapping("list/{shard}")
- public Flux<ChatRoomInfoTo> list(@PathVariable int shard)
+ @GetMapping("list")
+ public Flux<ChatRoomInfoTo> list()
{
return chatHome
- .getChatRooms(shard)
+ .getChatRooms()
.map(chatroom -> ChatRoomInfoTo.from(chatroom));
}
@PostMapping("/store")
public void store()
{
- Arrays
- .stream(ownedShards)
- .forEach(i -> storageStrategy.write(chatHome.getChatRooms(i))); // TODO: Sharded Storage
+ storageStrategy.write(chatHome.getChatRooms());
}
}