]> git.basschouten.com Git - openhab-addons.git/blob
14037517fba1249aed34a281b1871158b253142b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.io.imperihome.internal.handler;
14
15 import javax.servlet.http.HttpServletRequest;
16
17 import org.openhab.io.imperihome.internal.model.RoomList;
18 import org.openhab.io.imperihome.internal.processor.DeviceRegistry;
19
20 /**
21  * Rooms list request handler.
22  *
23  * @author Pepijn de Geus - Initial contribution
24  */
25 public class RoomListHandler {
26
27     private final DeviceRegistry deviceRegistry;
28
29     public RoomListHandler(DeviceRegistry deviceRegistry) {
30         this.deviceRegistry = deviceRegistry;
31     }
32
33     public RoomList handle(HttpServletRequest req) {
34         RoomList response = new RoomList();
35         response.setRooms(deviceRegistry.getRooms());
36         return response;
37     }
38 }