2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.freebox.internal.api.model;
15 import java.util.List;
18 * The {@link FreeboxLanHost} is the Java class used to map the "LanHost"
19 * structure used by the Lan Hosts Browser API
20 * https://dev.freebox.fr/sdk/os/lan/#lan-browser
22 * @author Laurent Garnier - Initial contribution
24 public class FreeboxLanHost {
26 private String primaryName;
27 private String hostType;
28 private boolean primaryNameManual;
29 private FreeboxLanHostL2Ident l2ident;
30 private String vendorName;
31 private boolean persistent;
32 private boolean reachable;
33 private long lastTimeReachable;
34 private boolean active;
35 private long lastActivity;
36 private List<FreeboxLanHostName> names;
37 private List<FreeboxLanHostL3Connectivity> l3connectivities;
39 public String getMAC() {
40 return (l2ident != null && l2ident.isMacAddress()) ? l2ident.getId() : null;
43 public String getId() {
47 public String getPrimaryName() {
51 public String getHostType() {
55 public boolean isPrimaryNameManual() {
56 return primaryNameManual;
59 public FreeboxLanHostL2Ident getL2Ident() {
63 public String getVendorName() {
67 public boolean isPersistent() {
71 public boolean isReachable() {
75 public long getLastTimeReachable() {
76 return lastTimeReachable;
79 public boolean isActive() {
83 public long getLastActivity() {
87 public List<FreeboxLanHostName> getNames() {
91 public List<FreeboxLanHostL3Connectivity> getL3Connectivities() {
92 return l3connectivities;