]> git.basschouten.com Git - openhab-addons.git/blob
e628cb2f2f83ab6ed02328a2c5bdd954682e1978
[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.binding.freeboxos.internal.api.rest;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.freeboxos.internal.api.FreeboxException;
17 import org.openhab.binding.freeboxos.internal.api.Response;
18
19 import inet.ipaddr.IPAddress;
20
21 /**
22  * The {@link LanManager} is the Java class used to handle api requests related to lan
23  * https://dev.freebox.fr/sdk/os/system/#
24  *
25  * @author GaĆ«l L'hopital - Initial contribution
26  */
27 @NonNullByDefault
28 public class LanManager extends ConfigurableRest<LanManager.LanConfig, LanManager.Config> {
29     private static final String PATH = "lan";
30
31     protected static class Config extends Response<LanConfig> {
32     }
33
34     private static enum Mode {
35         ROUTER,
36         BRIDGE,
37         UNKNOWN;
38     }
39
40     public static record LanConfig(IPAddress ip, String name, String nameDns, String nameMdns, String nameNetbios,
41             Mode mode) {
42     }
43
44     public LanManager(FreeboxOsSession session) throws FreeboxException {
45         super(session, LoginManager.Permission.NONE, Config.class, session.getUriBuilder().path(PATH), CONFIG_PATH);
46         session.addManager(LanBrowserManager.class, new LanBrowserManager(session, getUriBuilder()));
47     }
48 }